ESCOMP / CMEPS

NUOPC Community Mediator for Earth Prediction Systems
https://escomp.github.io/CMEPS/
22 stars 78 forks source link

Compiling error when ESMF_AWARE_THREADING is on #482

Closed nmizukami closed 2 months ago

nmizukami commented 2 months ago

I am trying to run hybrid parallel configuration in CTSM-mizuRoute. pelayout is set to like this (see ROF)

Comp  NTASKS  NTHRDS  ROOTPE PSTRIDE
CPL :   3840/     1;    128      1
ATM :    128/     1;      0      1
LND :   3840/     1;    128      1
ICE :   3840/     1;    128      1
OCN :   3840/     1;    128      1
ROF :    128/    10;    128      1
GLC :   3840/     1;    128      1
WAV :   3840/     1;    128      1
ESP :      1/     1;      0      1
ESMF_AWARE_THREADING is True

Now, I get compiling error, coming from undefined variables

/glade/u/home/mizukami/proj/ctsm-mizuRoute/CTSM/components/cmeps/cime_config/../cesm/driver/esm.F90(1004): error #6404: This name does not have a type, and must have an explicit type.   [CNT]
/glade/u/home/mizukami/proj/ctsm-mizuRoute/CTSM/components/cmeps/cime_config/../cesm/driver/esm.F90(1099): error #6498: The use-name for this local-name is not defined.   [ROFSETVM]

First one is easily fixed by just adding line integer:: cnt in esm.F90 file Fixing the second error require adding few lines in /nuopc/rof_comp_nuopc.F90 in ROF model (here mizuRoute), adding use NUOPC_Model , only : SetVM and public :: SetVM. This is how MOSART code does now.

I am using cmeps_v0.4.1-2792-g16abe9e7, which is old. However, cmeps1.0.2 has the same issue.

billsacks commented 2 months ago

Thanks for reporting and diagnosing the issue. I have opened a PR to fix this (#485) - note that the declaration needs to be in an ifdef to avoid compiler warnings.