Skip to content

Commit

Permalink
Do GLC -> MED based on med_to_glc rather than run_glc
Browse files Browse the repository at this point in the history
When this was based on run_glc, NOEVOLVE cases were failing like this:

20240319 135112.648 ERROR            PET0000 ESMF_ArrayGet.F90:1949 ESMF_ArrayGetFPtr Object being used before creation  - Bad Object
20240319 135112.649 ERROR            PET0000 ESMF_FieldGet.F90:2634 ESMF_FieldGetDataPtr Object being used before creation  - Internal subroutine call returned Error
20240319 135112.649 ERROR            PET0000 nuopc_shr_methods.F90:304 Object being used before creation  - Passing error in return code
20240319 135112.649 ERROR            PET0000 glc_import_export.F90:475 Object being used before creation  - Passing error in return code
20240319 135112.649 ERROR            PET0000 glc_comp_nuopc.F90:481 Object being used before creation  - Passing error in return code
20240319 135112.649 ERROR            PET0000 ESM0001:src/addon/NUOPC/src/NUOPC_Driver.F90:2901 Object being used before creation  - Phase 'IPDv01p3' Initialize for modelComp 3: GLC did not return ESMF_SUCCESS
20240319 135112.649 ERROR            PET0000 ESM0001:src/addon/NUOPC/src/NUOPC_Driver.F90:1985 Object being used before creation  - Passing error in return code
20240319 135112.649 ERROR            PET0000 ensemble:src/addon/NUOPC/src/NUOPC_Driver.F90:2901 Object being used before creation  - Phase 'IPDv02p3' Initialize for modelComp 1: ESM0001 did not return ESMF_SUCCESS
20240319 135112.649 ERROR            PET0000 ensemble:src/addon/NUOPC/src/NUOPC_Driver.F90:1990 Object being used before creation  - Passing error in return code
20240319 135112.649 ERROR            PET0000 ensemble:src/addon/NUOPC/src/NUOPC_Driver.F90:489 Object being used before creation  - Passing error in return code
20240319 135112.649 ERROR            PET0000 esmApp.F90:134 Object being used before creation  - Passing error in return code
20240319 135112.649 INFO             PET0000 Finalizing ESMF

This fails in the InitializeRealize call to export_fields, and
specifically in this:

       ! Set scalars in export state
       call State_SetScalar(dble(get_nx_tot(instance_index=ns)), flds_scalar_index_nx, &
            NStateExp(ns), flds_scalar_name, flds_scalar_num, rc)

So it seems like we need to have GLC -> MED in the run sequence for
initialization to work correctly.
  • Loading branch information
billsacks committed Mar 20, 2024
1 parent 8b02ffe commit ac458c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cime_config/runseq/runseq_TG.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def gen_runseq(case, coupling_times):
runseq.add_action ("MED med_phases_prep_glc" , med_to_glc)
runseq.add_action ("MED -> GLC :remapMethod=redist" , med_to_glc)
runseq.add_action ("GLC" , run_glc)
runseq.add_action ("GLC -> MED :remapMethod=redist" , run_glc)
# Need to do GLC -> MED even if not running GLC; otherwise, we get a
# failure in InitializeRealize ("Object being used before creation")
runseq.add_action ("GLC -> MED :remapMethod=redist" , med_to_glc)
runseq.add_action ("MED med_phases_history_write" , True)

runseq.leave_time_loop(True)
Expand Down
4 changes: 3 additions & 1 deletion cime_config/runseq/runseq_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ def gen_runseq(case, coupling_times):
runseq.add_action("MED med_phases_prep_glc" , med_to_glc)
runseq.add_action("MED -> GLC :remapMethod=redist" , med_to_glc)
runseq.add_action("GLC" , run_glc)
runseq.add_action("GLC -> MED :remapMethod=redist" , run_glc)
# Need to do GLC -> MED even if not running GLC; otherwise, we get a
# failure in InitializeRealize ("Object being used before creation")
runseq.add_action("GLC -> MED :remapMethod=redist" , med_to_glc)
runseq.add_action("MED med_phases_post_glc" , run_glc)

shutil.copy(os.path.join(caseroot, "CaseDocs", "nuopc.runseq"), rundir)

0 comments on commit ac458c3

Please sign in to comment.