From 55c8c8600ec12bb0ca0b5f6587c36e9e045b95d3 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 26 Oct 2021 12:30:55 -0600 Subject: [PATCH 1/2] initialize mytask and master_task here --- drivers/nuopc/ocn_import_export.F90 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/nuopc/ocn_import_export.F90 b/drivers/nuopc/ocn_import_export.F90 index 1b01a058..e3afee94 100644 --- a/drivers/nuopc/ocn_import_export.F90 +++ b/drivers/nuopc/ocn_import_export.F90 @@ -115,11 +115,12 @@ subroutine ocn_advertise_fields(gcomp, importState, exportState, flds_scalar_nam ! input/output variables type(ESMF_GridComp) :: gcomp type(ESMF_State) :: importState - type(ESMF_State) :: exportState + type(ESMF_State) :: exportState character(len=*) , intent(in) :: flds_scalar_name integer , intent(out) :: rc ! local variables + type(ESMF_VM) :: vm integer :: n character(CS) :: stdname character(CS) :: cvalue @@ -137,10 +138,16 @@ subroutine ocn_advertise_fields(gcomp, importState, exportState, flds_scalar_nam if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO) + ! pop has not yet initialized my_task and master_task so do it here + master_task = 0 + call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call ESMF_VMGet(vm, localPet=my_task, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + !----------------- ! optional input from cice columns due to ice thickness categories !----------------- - ! Note that flds_i2o_per_cat is set by the env_run.xml variable CPL_I2O_PER_CAT ! This xml variable is set by the POP build-namelist call NUOPC_CompAttributeGet(gcomp, name='flds_i2o_per_cat', value=cvalue, rc=rc) From 4f7f28bea0efd94cc0fd1d5288f0c5534f4e8bbd Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 26 Oct 2021 15:21:35 -0600 Subject: [PATCH 2/2] remove whitespace --- drivers/nuopc/ocn_import_export.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nuopc/ocn_import_export.F90 b/drivers/nuopc/ocn_import_export.F90 index e3afee94..6608e2cd 100644 --- a/drivers/nuopc/ocn_import_export.F90 +++ b/drivers/nuopc/ocn_import_export.F90 @@ -115,7 +115,7 @@ subroutine ocn_advertise_fields(gcomp, importState, exportState, flds_scalar_nam ! input/output variables type(ESMF_GridComp) :: gcomp type(ESMF_State) :: importState - type(ESMF_State) :: exportState + type(ESMF_State) :: exportState character(len=*) , intent(in) :: flds_scalar_name integer , intent(out) :: rc