GEOS-ESM/FVdycoreCubed_GridComp

Enable FV standalone to work without a (fake) restart file

Closed this issue · 6 comments

FV has the ability to generate synthetic restarts. The requirement by MAPL that components have a restart should be relaxed somehow. This ticket should probably be opened in MAPL, but for now it is driven by the requirement for this repo.

A related ticket was opened for the CTM: GEOS-ESM/GEOSctm#17

When I do not provide a restart file, I receive the following message:

Character Resource Parameter DYN_INTERNAL_RESTART_FILE: -fvcore_internal_rst
Integer*4 Resource Parameter DYN_INTERNAL_HEADER: 1
WARNING: use of '+' or '-' in the restart name 'fvcore_internal_rst' allows boo
tstrapping!
ERROR: Required restart fvcore_internal_rst does not exist!
MAPL_ESMFStateReadFromFile 4960
MAPL_ESMFStateReadFromFile 4960
DYNMAPL_GenericInitialize 1509
DYNMAPL_GenericInitialize 1509
MAPL_ESMFStateReadFromFile 4960
ESMF_StatePrint: (pet 0):
State name: DYN_INTERNAL

A restart file might not be needed at all. If one is not provided, i.e., not including the setting:

DYN_INTERNAL_RESTART_FILE: -fvcore_internal_rst

the code automatically sets ColdRestart to 1.

The problem occurs in the following section of StandAlone_DynAdvCore_GridCompMod.F90 (Lines 215-235):

  call ESMF_StateGet  (GIM(DynCore), 'TRADV', BUNDLE1, RC=STATUS )
  VERIFY_(STATUS)

  call ESMF_FieldBundleGet(BUNDLE1, fieldCount=numTracers,  rc=STATUS)
  VERIFY_(STATUS)

  IF ( MAPL_AM_I_ROOT() ) PRINT*, 'Number of tracers: ', numTracers

  call ESMF_StateGet  (GIM(AdvCore), 'TRADV', BUNDLE2, RC=STATUS )
  VERIFY_(STATUS)

  if (numTracers > 0) then
     do I=1, numTracers
        call ESMF_FieldBundleGet (BUNDLE1, fieldIndex=I, field=FIELD, RC=STATUS)
        VERIFY_(STATUS)

        call MAPL_FieldBundleAdd ( BUNDLE2, field, rc=STATUS )
        VERIFY_(STATUS)

     end do
  end if

The code fails in:

    call MAPL_FieldBundleAdd ( BUNDLE2, field, rc=STATUS )

I am trying to figure out why?
The fields in the DynCore bundle are added to the AdvCore bundle.

@JulesKouatchou Could you try the following:

  1. In your resource file do not specify any dynamical core restart (and most definitely do not use the hyphen symbol "-"), i.e. comment the restart line altogether
  2. Add
    COLDSTART: 1

This should fill the FV internal state with some prescribed values, that should be good enough to bootstrap without a restart

I am closing the ticket. If your issues still persist, please open a new issue

Here is the reason why the code was crashing. The file AdvCore_GridCompMod.F90 has:

call MAPL_AddImportSpec( gc,                              &
    SHORT_NAME = 'TRADV',                                        &
    LONG_NAME  = 'advected_quantities',                        &
    UNITS      = 'unknown',                                    &
    DATATYPE   = MAPL_BundleItem,               &
    RC=STATUS  )

instead of:

call MAPL_AddImportSpec( gc,                              &
    SHORT_NAME = 'TRADV',                                        &
    LONG_NAME  = 'advected_quantities',                        &
    UNITS      = 'unknown',                                    &
    DATATYPE   = MAPL_BundleItem,               &
    DIMS       = MAPL_DimsHorzVert,                           &
    VLOCATION  = MAPL_VLocationCenter,                        &
    RC=STATUS  )

Note that I added the arguments DIMS and VLOCATION. They used to be there in an older version of the code. In any case, the code passes now the initialization stage. There is another issue (in the run method) that I am trying to address.

I am finally able to run the code. I needed to have the setting:

ADIABATIC: 1

in the AGCM.rc file. It used to be enough to have the setting (ADIABATIC: .true.) in the fv_layout.rc file.