diff --git a/interface/framework/init_dim_obs_f_pdaf.F90 b/interface/framework/init_dim_obs_f_pdaf.F90 index a0280f9c..11547a4e 100755 --- a/interface/framework/init_dim_obs_f_pdaf.F90 +++ b/interface/framework/init_dim_obs_f_pdaf.F90 @@ -966,7 +966,8 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f) ! Error if observation deeper than clmstatevec_max_layer if(clmobs_layer(i) > min(clmstatevec_max_layer, col%nbedrock(c))) then - print *, "TSMP-PDAF mype(w)=", mype_world, ": ERROR observation layer deeper than clmstatevec_max_layer or bedrock." + print *, "TSMP-PDAF mype(w)=", mype_world, ": ERROR " + print *, "Observation layer deeper than clmstatevec_max_layer or bedrock." print *, "i=", i print *, "c=", c print *, "clmobs_layer(i)=", clmobs_layer(i) diff --git a/interface/framework/init_dim_obs_pdaf.F90 b/interface/framework/init_dim_obs_pdaf.F90 index 6ce590e6..48f29c08 100755 --- a/interface/framework/init_dim_obs_pdaf.F90 +++ b/interface/framework/init_dim_obs_pdaf.F90 @@ -959,7 +959,8 @@ SUBROUTINE init_dim_obs_pdaf(step, dim_obs_p) ! Error if observation deeper than clmstatevec_max_layer if(clmobs_layer(i) > min(clmstatevec_max_layer, col%nbedrock(c))) then - print *, "TSMP-PDAF mype(w)=", mype_world, ": ERROR observation layer deeper than clmstatevec_max_layer or bedrock." + print *, "TSMP-PDAF mype(w)=", mype_world, ": ERROR " + print *, "Observation layer deeper than clmstatevec_max_layer or bedrock." print *, "i=", i print *, "c=", c print *, "clmobs_layer(i)=", clmobs_layer(i) diff --git a/interface/framework/init_parallel_pdaf.F90 b/interface/framework/init_parallel_pdaf.F90 index a8866679..98528e7a 100644 --- a/interface/framework/init_parallel_pdaf.F90 +++ b/interface/framework/init_parallel_pdaf.F90 @@ -44,18 +44,18 @@ SUBROUTINE init_parallel_pdaf(dim_ens, screen) ! over to PDAF in the call to ! PDAF\_init\_parallel. ! -! 3 Communicators are generated:\\ +! 3 Communicators are generated: ! - COMM\_filter: Communicator in which the -! filter itself operates\\ +! filter itself operates ! - COMM\_model: Communicators for parallel -! model forecasts\\ +! model forecasts ! - COMM\_couple: Communicator for coupling -! between models and filter\\ -! Other variables that have to be initialized are:\\ +! between models and filter +! Other variables that have to be initialized are: ! - filterpe - Logical: Does the PE execute the -! filter?\\ +! filter? ! - my\_ensemble - Integer: The index of the PE's -! model task\\ +! model task ! - local\_npes\_model - Integer array holding ! numbers of PEs per model task ! diff --git a/interface/framework/init_pdaf.F90 b/interface/framework/init_pdaf.F90 index 20fc01e8..49943004 100644 --- a/interface/framework/init_pdaf.F90 +++ b/interface/framework/init_pdaf.F90 @@ -206,7 +206,8 @@ SUBROUTINE init_pdaf() #ifdef PDAF_DEBUG ! Debug output: local state dimension array - if (mype_model == 0) WRITE(*, '(a,x,a,i5,x,a,x)', advance="no") "TSMP-PDAF-debug", "mype(w)=", mype_world, "init_pdaf: dim_state_p_count in modified:" + if (mype_model == 0) WRITE(*, '(a,x,a,i5,x,a,x)', advance="no") "TSMP-PDAF-debug", "mype(w)=", mype_world, & + "init_pdaf: dim_state_p_count in modified:" if (mype_model == 0) WRITE(*, *) dim_state_p_count #endif diff --git a/interface/framework/integrate_pdaf.F90 b/interface/framework/integrate_pdaf.F90 index 35c91b4a..8446f3e6 100644 --- a/interface/framework/integrate_pdaf.F90 +++ b/interface/framework/integrate_pdaf.F90 @@ -24,5 +24,8 @@ !------------------------------------------------------------------------------------------- subroutine integrate + + implicit none + print *, "Hello World!" end subroutine integrate diff --git a/interface/framework/mod_assimilation.F90 b/interface/framework/mod_assimilation.F90 index 170b2617..63093c38 100755 --- a/interface/framework/mod_assimilation.F90 +++ b/interface/framework/mod_assimilation.F90 @@ -65,12 +65,15 @@ MODULE mod_assimilation ! *** Variables specific for TSMP-PDAF *** ! gw - INTEGER, ALLOCATABLE :: dim_state_p_count(:) !Vector holding local state vector dimensions for processors of a single model communicator + INTEGER, ALLOCATABLE :: dim_state_p_count(:) !Vector holding local state vector dimensions for + ! processors of a single model communicator ! gw end REAL, ALLOCATABLE :: obs(:) ! Vector holding all observations for Global domain INTEGER, ALLOCATABLE :: obs_index_l(:) ! Vector holding local state-vector indices of observations - INTEGER, ALLOCATABLE :: obs_interp_indices_p(:,:) ! Vector holding state-vector indices of grid cells surrounding interpolation for PE-local domain - INTEGER, ALLOCATABLE :: obs_interp_weights_p(:,:) ! Vector holding weights of grid cells surrounding observation for PE-local domain + INTEGER, ALLOCATABLE :: obs_interp_indices_p(:,:) ! Vector holding state-vector indices of grid cells + ! surrounding interpolation for PE-local domain + INTEGER, ALLOCATABLE :: obs_interp_weights_p(:,:) ! Vector holding weights of grid cells surrounding + ! observation for PE-local domain INTEGER, ALLOCATABLE :: local_dims_obs(:) ! Array for process-local observation dimensions INTEGER, ALLOCATABLE :: local_disp_obs(:) ! Observation displacement array for gathering. Displacement: #obs before current PE ! pdaf-ordered index: determined by domain-decomposition @@ -88,8 +91,10 @@ MODULE mod_assimilation REAL, ALLOCATABLE :: clm_obserr_p(:) ! Vector holding observation errors for CLM run at each PE-local domain REAL, ALLOCATABLE :: distance(:) ! Localization distance INTEGER, ALLOCATABLE :: global_to_local(:) ! Vector to map global index to local domain index - INTEGER, ALLOCATABLE :: longxy(:), latixy(:), longxy_obs(:), latixy_obs(:) ! longitude and latitude of grid cells and observation cells - INTEGER, ALLOCATABLE :: longxy_obs_floor(:), latixy_obs_floor(:) ! indices of grid cells with smaller lon/lat than observation location + INTEGER, ALLOCATABLE :: longxy(:), latixy(:), longxy_obs(:), latixy_obs(:) ! longitude and latitude of grid cells + ! and observation cells + INTEGER, ALLOCATABLE :: longxy_obs_floor(:), latixy_obs_floor(:) ! indices of grid cells with smaller lon/lat + ! than observation location INTEGER, ALLOCATABLE :: var_id_obs(:) ! for remote sensing data the variable identifier to group ! variables distributed over a grid surface area !kuw diff --git a/interface/framework/mod_read_obs.F90 b/interface/framework/mod_read_obs.F90 index 9c202acd..3e00b926 100755 --- a/interface/framework/mod_read_obs.F90 +++ b/interface/framework/mod_read_obs.F90 @@ -23,7 +23,7 @@ !------------------------------------------------------------------------------------------- module mod_read_obs - use iso_C_binding, only: c_int, c_ptr, c_loc + use, intrinsic :: iso_C_binding, only: c_int, c_ptr, c_loc implicit none diff --git a/interface/framework/mod_tsmp.F90 b/interface/framework/mod_tsmp.F90 index 2a79ad3b..09a4973a 100755 --- a/interface/framework/mod_tsmp.F90 +++ b/interface/framework/mod_tsmp.F90 @@ -23,7 +23,7 @@ !------------------------------------------------------------------------------------------- module mod_tsmp - use iso_c_binding, only: c_int, c_ptr, c_double + use, intrinsic :: iso_c_binding, only: c_int, c_ptr, c_double implicit none @@ -96,7 +96,7 @@ end subroutine update_tsmp interface subroutine init_n_domains_pfl(n_domains_p) bind(c) - use iso_c_binding, only: c_int + use, intrinsic :: iso_c_binding, only: c_int import implicit none INTEGER(c_int), INTENT(out) :: n_domains_p ! PE-local number of analysis domains @@ -105,7 +105,7 @@ end subroutine init_n_domains_pfl interface subroutine init_dim_l_pfl(dim_l) bind(c) - use iso_c_binding, only: c_int + use, intrinsic :: iso_c_binding, only: c_int import implicit none INTEGER(c_int), INTENT(out) :: dim_l ! Local state dimension diff --git a/interface/framework/prepoststep_ens_pdaf.F90 b/interface/framework/prepoststep_ens_pdaf.F90 index c65c5258..b59dc2f2 100644 --- a/interface/framework/prepoststep_ens_pdaf.F90 +++ b/interface/framework/prepoststep_ens_pdaf.F90 @@ -211,7 +211,7 @@ SUBROUTINE prepoststep_ens_pdaf(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, & ! variance, dim_p, MPI_DOUBLE_PRECISION, & ! 0, comm_filter, MPIerr) call MPI_Gatherv(variance_p, dim_p, MPI_DOUBLE_PRECISION, variance, dim_state_p_count, & - dim_state_p_stride, MPI_DOUBLE_PRECISION, 0, comm_filter, MPIerr); + dim_state_p_stride, MPI_DOUBLE_PRECISION, 0, comm_filter, MPIerr) if (MPIerr /= MPI_SUCCESS) then print *,"mpi gather failed" call MPI_Abort(MPI_COMM_WORLD, 1, MPIerr) diff --git a/interface/framework/prodrinva_l_pdaf.F90 b/interface/framework/prodrinva_l_pdaf.F90 index 3169850c..9fa0e456 100644 --- a/interface/framework/prodrinva_l_pdaf.F90 +++ b/interface/framework/prodrinva_l_pdaf.F90 @@ -56,6 +56,7 @@ SUBROUTINE prodRinvA_l_pdaf(domain_p, step, dim_obs_l, rank, obs_l, A_l, C_l) USE mod_assimilation, ONLY: obs_index_l USE mod_parallel_pdaf, & ONLY: mype_filter + USE mod_parallel_pdaf, ONLY: abort_parallel USE mod_read_obs, ONLY: multierr USE mod_read_obs, ONLY: clm_obserr USE mod_read_obs, ONLY: pressure_obserr @@ -218,6 +219,10 @@ SUBROUTINE prodRinvA_l_pdaf(domain_p, step, dim_obs_l, rank, obs_l, A_l, C_l) #endif END DO END DO + CASE DEFAULT + + print *, "ERROR: unsupported multierr in prodrinva_l_pdaf.F90" + call abort_parallel() END SELECT diff --git a/interface/model/eclm/enkf_clm_5.F90 b/interface/model/eclm/enkf_clm_5.F90 index 873c9722..3ae9b829 100644 --- a/interface/model/eclm/enkf_clm_5.F90 +++ b/interface/model/eclm/enkf_clm_5.F90 @@ -67,7 +67,7 @@ subroutine clm_init(finname, pdaf_id, pdaf_max, mype) bind(C,name="clm_init") ! use cime_comp_mod, only : cime_final !!<< TSMP PDAF comment out end !!>> TSMP PDAF addition beginning - use iso_C_binding, only: c_char, c_int + use, intrinsic :: iso_C_binding, only: c_char, c_int use enkf_clm_mod, only: COMM_model_clm #if defined CLMSA use enkf_clm_mod, only: define_clm_statevec @@ -202,7 +202,7 @@ end subroutine clm_init subroutine clm_advance(ntstep, tstartcycle, mype) bind(C,name="clm_advance") use cime_comp_mod, only : cime_run use enkf_clm_mod, only : set_clm_statevec - use iso_C_binding, only : c_int + use, intrinsic :: iso_C_binding, only : c_int implicit none !-------------------------------------------------------------------------- diff --git a/interface/model/eclm/enkf_clm_mod_5.F90 b/interface/model/eclm/enkf_clm_mod_5.F90 index 81ce1fd2..1e43450c 100755 --- a/interface/model/eclm/enkf_clm_mod_5.F90 +++ b/interface/model/eclm/enkf_clm_mod_5.F90 @@ -24,8 +24,8 @@ module enkf_clm_mod - use iso_c_binding, only: c_int, c_double, c_char - use IEEE_ARITHMETIC, only: ieee_is_nan + use, intrinsic :: iso_c_binding, only: c_int, c_double, c_char + use, intrinsic :: IEEE_ARITHMETIC, only: ieee_is_nan ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8, SHR_KIND_CL diff --git a/interface/model/eclm/print_update_clm_5.F90 b/interface/model/eclm/print_update_clm_5.F90 index 09dbc681..6a38794e 100644 --- a/interface/model/eclm/print_update_clm_5.F90 +++ b/interface/model/eclm/print_update_clm_5.F90 @@ -25,7 +25,7 @@ #if defined CLMSA subroutine print_update_clm(ts,ttot) bind(C,name="print_update_clm") - use iso_c_binding, only : c_int + use, intrinsic :: iso_c_binding, only : c_int use shr_kind_mod , only : r8 => shr_kind_r8 use subgridavemod, only : p2g, c2g use domainMod , only : ldomain