Structure of PDAF inside TSMP
Danger
DEPRECATED: This documentation is deprecated and no longer maintained. Please refer to the updated documentation for current information.
TSMP-PDAF: https://hpscterrsys.github.io/pdaf
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/pdaf/framework:
pdaf_terrsysmp.F90: pdaf_terrsysmp
-> assimilate_pdaf.F90: assimilate_pdaf
-> PDAF_assimilate_enkf
Inside PDAF, pdaf/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)Model equivalents of
COMM_modelare set:COMM_model_oas,COMM_model_pfl,COMM_model_clmModel equivalent of
COMM_coupleis set:COMM_model_clm
-
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/pdaf/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 Communicator COMM_model
Variable names for the model communicator:
ParFlow standalone:
COMM_model(init_parallel_pdaf.F90)COMM_model_pfl(init_parallel_pdaf.F90)C:
COMM_model_pfl(enkf_parflow.h)C:
pfcomm(enkfparflowinitinenkf_parflow.c)C: handed to
amps_EmbeddedInitComm
CLM (3.5) standalone:
COMM_model(init_parallel_pdaf.F90)COMM_model_clm(init_parallel_pdaf.F90)COMM_model_clm(clm_initinenkf_clm.F90)handed to
spmd_initandmct_world_init
Coupled simulation using OASIS:
COMM_model(init_parallel_pdaf.F90)COMM_model_oas(init_parallel_pdaf.F90)handed over to OASIS to
oasis_init_compinmod_oasis_method.F90
The two call-sequences of loading COMM_model_oas in coupled
simulations:
ParFlow: Sets
amps_CommWorldenkfparflowinitinenkf_parflow.camps_initinoas3/amps_init.c(entering ParFlow)oas_pfl_initinoas3/oas_pfl_initprism_init_comp_proto(mod_prism) /oasis_init_compinmod_oasis_method.F90(entering OASIS)
CLM (3.5): Sets
kl_commclm_initinenkf_clm.F90oas_clm_initinoas_clm_init.F90(entering CLM)prism_init_comp_proto(mod_prism)/oasis_init_compinmod_oasis_method.F90(entering OASIS)
AMPS used by ParFlow in TSMP-PDAF
Information on AMPS (Another Message Passing System): https://github.com/parflow/parflow/blob/master/pfsimulator/amps/oas3/intro.dxx
The directory for AMPS used in TSMP-PDAF is set using the
CMAKE-variable PARFLOW_AMPS_LAYER in build_interface_parflow.ksh.
AMPS directory / PARFLOW_AMPS_LAYER for
ParFlow standalone:
da(mpi1)Coupled ParFlow:
oas3
AMPS-Layer da / mpi1
da is a new AMPS-Layer introduced for ParFlow with TSMP-PDAF.
da is based on the existing AMPS-Layer mpi1.
The changes between da and mpi1 are small, therefore in
TSMP2-PDAF, da will be removed and replaced by a pre-patched version
of mpi1.
Changes:
dacommcommunicator defined and suspected to be unused. ParFlow-standalone testmodel needed to confirm.commented out
MPI_Finalize
AMPS-Layer oas3
oas3 is an existing AMPS-Layer.
oas3 uses the communicator setup defined in
prism_init_comp_proto/oasis_init_comp, where COMM_model_oas is
inserted.
CMEM
If you want to use the CMEM operator, you have to download the source
code under https://confluence.ecmwf.int/display/LDAS/CMEM+Download
(Tested: Version 5.1) and copy it into the framework directory of
TSMP-PDAF.