Structure of PDAF inside TSMP
Call Graph for TSMP-PDAF
Here is an exemplary call-graph from TSMP-PDAF’s main program
pdaf_terrsysmp() inside pdaf_terrsysmp.F90 up to the function,
where the enkf update is carried out:
PDAF_enkf_analysis_rlm/PDAF_enkf_analysis_rsm.
Inside TSMP, TSMP/bldsva/intf_DA/pdaf1_1/framework:
pdaf_terrsysmp.F90: pdaf_terrsysmp
-> assimilate_pdaf.F90: assimilate_pdaf
-> PDAF_assimilate_enkf
Inside PDAF, pdaf1_1/src/:
PDAF-D_assimilate_enkf.F90: PDAF_assimilate_enkf
-> PDAF-D_put_state_enkf.F90: PDAF_put_state_enkf
-> PDAF-D_enkf_update.F90: PDAF_enkf_update
-> PDAF-D_enkf_analysis_rlm.F90: PDAF_enkf_analysis_rlm
or
-> PDAF-D_enkf_analysis_rsm.F90: PDAF_enkf_analysis_rsm
Important Functions of TSMP-PDAF
pdaf_terrsysmp (main program)
Subroutines:
init_parallel_pdaf()MPI_Initif not yet done (should be done)Set
npes_world,mype_worldRead command line input:
n_modeltasksInitialize communicators for ensemble evaluations
consistency checks
n_modeltasks > npes_worldand (not used sincedim_ensis set to dummy-zero)n_modeltasks > dim_ens
COMM_ensemble(local copy ofMPI_COMM_WORLD)COMM_model: Generate communicators for model runsSet
local_npes_modeldepending on complete numbernpes_worldandn_modeltasksExample:
mype_world=24and 4 PEs per model, then mype_world will be model task/color9 = floor(24/4)+1and rank0(25->1,26->2,27->3).
COMM_filter: Same asCOMM_model, but only first task used.COMM_couple: For each rank inCOMM_model(example 4 ranks), there is a task inCOMM_couplewithn_modeltasksranks (example 48)Finally
da_commis set toCOMM_model; andcosmo_input_suffixis set
-
read parameter file
enkfpf.parSet model number for a process
Set input function names
Call model-specific input functions
clm_initenkfparflowinit(some more allocations in ParFlow part)cosmo_init
initialize_tsmp()
File: ./bldsva/intf_DA/pdaf1_1/model/wrapper_tsmp.c
Subroutines:
clm_initSetting
nlfilename(essentially the same asfinname?)Initialize Communicators depending on mode
Initialize ESMF (needed for time-manager)
Initialize timing library, and set full path to namelist
Initialize Orbital parameters (
shr_orb_params)Initialize land model (
clm_init0, clm_init1, clm_init2)Initialize “external” atmospheric forcing (
atmdrv_init)
enkfparflowinit1.
List of interesting variables of TSMP-PDAF
local_npes_model: PEs per ensemblen_modeltasks: Number of parallel model tasksnpes_world: Number of MPI processes inMPI_COMM_WORLDmype_world: Rank of calling process inMPI_COMM_WORLDpf_statevec: ParFlow-Statevector in C-wrapperfrom
enkf_parflow.hand set ininitialize_tsmpfrom thewrapper_tsmp.c
pf_statevec_fortran: ParFlow-Statevector in Fortran-part of TSMP-PDAFdefined in
init_pdaf.F90byC_F_POINTERsubroutine (Doc from Gnu-Compiler: https://gcc.gnu.org/onlinedocs/gfortran/C_005fF_005fPOINTER.html)takes values from
pf_statevec
subvec_p: state vector pressure (fromenkf_parflow.c:371)defined:
enkf_parflow.h, allocated:wrapper_tsmp.c
tag_model_clm, (0),tag_model_parflow(1) andtag_model_cosmo(2) identifiers for the component modelsdefined
mod_tsmp.F90used throughout TSMP-PDAF, for example in
collect_state_pdaf.F90
Model Communicators
AMPS directory:
ParFlow standalone: amps directory
da/is used,Coupled ParFlow-CLM component models: amps directory
oas3/is used.
Variable names for the model communicator:
ParFlow standalone:
comm_model-> C:comm_model_pdaf->pfcomm(enkf_parflow/enkfparflowinit) ->amps_CommWorld(da/amps_init.c)
Coupled with OASIS:
comm_model->da_comm(init_parallel_pdaf) -> C:fsubcomm-> C-version not usedcomm_model->da_comm(init_parallel_pdaf) ->mpi_comm_global(mod_oasis_method)