-
Notifications
You must be signed in to change notification settings - Fork 7
Compiling and Run ELM PFLOTRAN
(UPDATED: @2019-08-06 Now ELM-PFLOTRAN coupling can be setup using specific COMPSETs such as CLM45%PFCN*)
./create_newcase --case $HOME/project_acme/cases/testalmpf --mach mymac --compiler gnu --mpilib mpich --compset I1850PFCNRDCTCBC --res CLM_USRDAT --srcroot $HOME/mygithub/ACME
NOTE: Currently, support 12 compsets:
I1850PFCNRDCTC
I20TRPFCNRDCTC
ICB1850PFCNRDCTC
ICB20TRPFCNRDCTC
I1850GSWPFCNRDCTC
I20TRGSWPFCNRDCTC
I1850PFCNRDCTCBC
I20TRPFCNRDCTCBC
ICB1850PFCNRDCTCBC
ICB20TRPFCNRDCTCBC
I1850GSWPFCNRDCTCBC
I20TRGSWPFCNRDCTCBC
Three E3SM configuration files to be modified as following under CASE directory, e.g. the case built above
cd $HOME/project_acme/cases/testalmpf
Edit this file (any editor, e.g. vi) for the following xml tag '-cppdefs', aka removing '-DCOLUMN_MODE'.
vi env_build.xml
<group id="build_component_clm">
<entry id="CLM_CONFIG_OPTS" value="-phys clm4_5 -cppdefs '-DMODAL_AER -DCLM_PFLOTRAN -DCOLUMN_MODE'">
<type>char</type>
Usually, the PETSc library path and CLM_PFLOTRAN source directory are pre-defined in machine file. If not, they can be added into this env_mach_specific.xml
, as following (of course both ENV variables must be defined in shell or .bashrc):
<environment_variables>
<env name="PETSC_PATH">$ENV{PETSC_DIR}</env>
<env name="CLM_PFLOTRAN_SOURCE_DIR">/Users/$USER/mygitlab/pflotran-interface/src/pflotran-elm-interface</env>
<env name="PFLOTRAN_INC"> -I$ENV{CLM_PFLOTRAN_SOURCE_DIR} -I$ENV{PETSC_DIR}/include</env>
<env name="PFLOTRAN_LIB"> -L$ENV{CLM_PFLOTRAN_SOURCE_DIR} -lpflotran -L$ENV{PETSC_DIR}/lib -lpetsc -lmetis -lparmetis</env>
</environment_variables>
IN CASE that you don't want to include PETSc and/or PFLOTRAN libraries in e3sm.exe, then comment out as following:
<!--
<environment_variables>
<env name="PETSC_PATH">$ENV{PETSC_DIR}</env>
<env name="CLM_PFLOTRAN_SOURCE_DIR">/Users/$USER/mygitlab/pflotran-interface/src/pflotran-elm-interface</env>
<env name="PFLOTRAN_INC"> -I$ENV{CLM_PFLOTRAN_SOURCE_DIR} -I$ENV{PETSC_DIR}/include</env>
<env name="PFLOTRAN_LIB"> -L$ENV{CLM_PFLOTRAN_SOURCE_DIR} -lpflotran -L$ENV{PETSC_DIR}/lib -lpetsc -lmetis -lparmetis</env>
</environment_variables>
-->
IF cloning this folked (and specific-modified) [E3SM](https://github.com/fmyuan/E3SM.git, branch 'elm-dev'), you may modify env_run.xml
to switch run-time ELM-PFLOTRAN interface as following,
./xmlchange --id CLM_INTERFACE_MODE --val pflotran
OTHERWISE, same codes and e3sm.exe can be run for non-PFLOTRAN coupled case.