diff --git a/config_src/mct_driver/MOM_ocean_model.F90 b/config_src/mct_driver/mom_ocean_model_mct.F90 similarity index 99% rename from config_src/mct_driver/MOM_ocean_model.F90 rename to config_src/mct_driver/mom_ocean_model_mct.F90 index 2a984916aa..ec894f1ebb 100644 --- a/config_src/mct_driver/MOM_ocean_model.F90 +++ b/config_src/mct_driver/mom_ocean_model_mct.F90 @@ -1,5 +1,5 @@ !> Top-level module for the MOM6 ocean model in coupled mode. -module MOM_ocean_model +module MOM_ocean_model_mct ! This file is part of MOM6. See LICENSE.md for the license. @@ -35,10 +35,10 @@ module MOM_ocean_model use MOM_marine_ice, only : iceberg_forces, iceberg_fluxes, marine_ice_init, marine_ice_CS use MOM_restart, only : MOM_restart_CS, save_restart use MOM_string_functions, only : uppercase -use MOM_surface_forcing, only : surface_forcing_init, convert_IOB_to_fluxes -use MOM_surface_forcing, only : convert_IOB_to_forces, ice_ocn_bnd_type_chksum -use MOM_surface_forcing, only : ice_ocean_boundary_type, surface_forcing_CS -use MOM_surface_forcing, only : forcing_save_restart +use MOM_surface_forcing_mct, only : surface_forcing_init, convert_IOB_to_fluxes +use MOM_surface_forcing_mct, only : convert_IOB_to_forces, ice_ocn_bnd_type_chksum +use MOM_surface_forcing_mct, only : ice_ocean_boundary_type, surface_forcing_CS +use MOM_surface_forcing_mct, only : forcing_save_restart use MOM_time_manager, only : time_type, get_time, set_time, operator(>) use MOM_time_manager, only : operator(+), operator(-), operator(*), operator(/) use MOM_time_manager, only : operator(/=), operator(<=), operator(>=) @@ -263,7 +263,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i type(param_file_type) :: param_file !< A structure to parse for run-time parameters logical :: use_temperature - call callTree_enter("ocean_model_init(), ocean_model_MOM.F90") + call callTree_enter("ocean_model_init(), MOM_ocean_model_mct.F90") if (associated(OS)) then call MOM_error(WARNING, "ocean_model_init called with an associated "// & "ocean_state_type structure. Model is already initialized.") @@ -477,7 +477,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, & integer :: secs, days integer :: is, ie, js, je - call callTree_enter("update_ocean_model(), MOM_ocean_model.F90") + call callTree_enter("update_ocean_model(), MOM_ocean_model_mct.F90") call get_time(Ocean_coupling_time_step, secs, days) dt_coupling = 86400.0*real(days) + real(secs) @@ -1187,4 +1187,4 @@ subroutine get_ocean_grid(OS, Gridp) return end subroutine get_ocean_grid -end module MOM_ocean_model +end module MOM_ocean_model_mct diff --git a/config_src/mct_driver/MOM_surface_forcing.F90 b/config_src/mct_driver/mom_surface_forcing_mct.F90 similarity index 99% rename from config_src/mct_driver/MOM_surface_forcing.F90 rename to config_src/mct_driver/mom_surface_forcing_mct.F90 index cf1461467c..dd26205866 100644 --- a/config_src/mct_driver/MOM_surface_forcing.F90 +++ b/config_src/mct_driver/mom_surface_forcing_mct.F90 @@ -1,4 +1,4 @@ -module MOM_surface_forcing +module MOM_surface_forcing_mct ! This file is part of MOM6. See LICENSE.md for the license. @@ -1006,7 +1006,7 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, restore_salt, character(len=200) :: TideAmp_file, gust_file, salt_file, temp_file ! Input file names. ! This include declares and sets the variable "version". #include "version_variable.h" - character(len=40) :: mdl = "MOM_surface_forcing" ! This module's name. + character(len=40) :: mdl = "MOM_surface_forcing_mct" ! This module's name. character(len=48) :: stagger character(len=48) :: flnam character(len=240) :: basin_file @@ -1378,4 +1378,4 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt) end subroutine ice_ocn_bnd_type_chksum -end module MOM_surface_forcing +end module MOM_surface_forcing_mct diff --git a/config_src/mct_driver/ocn_cap_methods.F90 b/config_src/mct_driver/ocn_cap_methods.F90 index 7e06b014d4..b42fa8ca7e 100644 --- a/config_src/mct_driver/ocn_cap_methods.F90 +++ b/config_src/mct_driver/ocn_cap_methods.F90 @@ -1,13 +1,13 @@ module ocn_cap_methods - use ESMF, only: ESMF_clock, ESMF_time, ESMF_ClockGet, ESMF_TimeGet - use MOM_ocean_model, only: ocean_public_type, ocean_state_type - use MOM_surface_forcing, only: ice_ocean_boundary_type - use MOM_grid, only: ocean_grid_type - use MOM_domains, only: pass_var - use MOM_error_handler, only: is_root_pe - use mpp_domains_mod, only: mpp_get_compute_domain - use ocn_cpl_indices, only: cpl_indices_type + use ESMF, only: ESMF_clock, ESMF_time, ESMF_ClockGet, ESMF_TimeGet + use MOM_ocean_model_mct, only: ocean_public_type, ocean_state_type + use MOM_surface_forcing_mct, only: ice_ocean_boundary_type + use MOM_grid, only: ocean_grid_type + use MOM_domains, only: pass_var + use MOM_error_handler, only: is_root_pe + use mpp_domains_mod, only: mpp_get_compute_domain + use ocn_cpl_indices, only: cpl_indices_type implicit none private diff --git a/config_src/mct_driver/ocn_comp_mct.F90 b/config_src/mct_driver/ocn_comp_mct.F90 index 8d9133d08b..5b581e0427 100644 --- a/config_src/mct_driver/ocn_comp_mct.F90 +++ b/config_src/mct_driver/ocn_comp_mct.F90 @@ -44,10 +44,10 @@ module ocn_comp_mct use mpp_domains_mod, only: mpp_get_compute_domain ! Previously inlined - now in separate modules -use MOM_ocean_model, only: ocean_public_type, ocean_state_type -use MOM_ocean_model, only: ocean_model_init , update_ocean_model, ocean_model_end -use MOM_ocean_model, only: convert_state_to_ocean_type -use MOM_surface_forcing, only: surface_forcing_CS, forcing_save_restart, ice_ocean_boundary_type +use MOM_ocean_model_mct, only: ocean_public_type, ocean_state_type +use MOM_ocean_model_mct, only: ocean_model_init , update_ocean_model, ocean_model_end +use MOM_ocean_model_mct, only: convert_state_to_ocean_type +use MOM_surface_forcing_mct, only: surface_forcing_CS, forcing_save_restart, ice_ocean_boundary_type use ocn_cap_methods, only: ocn_import, ocn_export ! FMS modules diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index 0e46a454f7..d6a7837c83 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -35,11 +35,11 @@ !! of model code, making calls into it and exposing model data structures in a !! standard way. !! -!! The MOM cap package includes the cap code itself (mom_cap.F90, mom_cap_methods.F90 -!! and mom_cap_time.F90), a set of time utilities (time_utils.F90) for converting between ESMF and FMS -!! time type and two modules MOM_ocean_model.F90 and MOM_surface_forcing.F90. MOM_surface_forcing.F90 +!! The MOM cap package includes the cap code itself (MOM_cap.F90, MOM_cap_methods.F90 +!! and MOM_cap_time.F90), a set of time utilities (time_utils.F90) for converting between ESMF and FMS +!! time type and two modules MOM_ocean_model_nuopc.F90 and MOM_surface_forcing_nuopc.F90. MOM_surface_forcing_nuopc.F90 !! converts the input ESMF data (import data) to a MOM-specific data type (surface_forcing_CS). -!! MOM_ocean_model.F90 contains routines for initialization, update and finalization of the ocean model state. +!! MOM_ocean_model_nuopc.F90 contains routines for initialization, update and finalization of the ocean model state. !! !! @subsection CapSubroutines Cap Subroutines !! @@ -60,15 +60,15 @@ !! !! Phase | MOM Cap Subroutine | Description !! ---------|--------------------------------------------------------------------|-------------------------------------- -!! Init | [InitializeP0] (@ref mom_cap_mod::initializep0) | Sets the Initialize Phase Definition +!! Init | [InitializeP0] (@ref MOM_cap_mod::initializep0) | Sets the Initialize Phase Definition !! | (IPD) version to use -!! Init | [InitializeAdvertise] (@ref mom_cap_mod::initializeadvertise) | Advertises standard names of import +!! Init | [InitializeAdvertise] (@ref MOM_cap_mod::initializeadvertise) | Advertises standard names of import !! | and export fields -!! Init | [InitializeRealize] (@ref mom_cap_mod::initializerealize) | Creates an ESMF_Grid or ESMF_Mesh +!! Init | [InitializeRealize] (@ref MOM_cap_mod::initializerealize) | Creates an ESMF_Grid or ESMF_Mesh !! | as well as ESMF_Fields for import !! | and export fields -!! Run | [ModelAdvance] (@ref mom_cap_mod::modeladvance) | Advances the model by a timestep -!! Final | [Finalize] (@ref mom_cap_mod::ocean_model_finalize) | Cleans up +!! Run | [ModelAdvance] (@ref MOM_cap_mod::modeladvance) | Advances the model by a timestep +!! Final | [Finalize] (@ref MOM_cap_mod::ocean_model_finalize) | Cleans up !! !! @section UnderlyingModelInterfaces Underlying Model Interfaces !! @@ -81,7 +81,7 @@ !! Note that for either the `ESMF_Grid` or `ESMF_Mesh` representation, the fields are translated into !! a 2D MOM specific surface boundary type and the distinction between the two is no longer there. !! Calls related to creating the grid are located in the [InitializeRealize] -!! (@ref mom_cap_mod::initializerealize) subroutine, which is called by the NUOPC infrastructure +!! (@ref MOM_cap_mod::initializerealize) subroutine, which is called by the NUOPC infrastructure !! during the intialization sequence. !! !! The cap determines parameters for setting up the grid by calling subroutines in the @@ -112,7 +112,7 @@ !! !! @subsection Initialization Initialization !! -!! During the [InitializeAdvertise] (@ref mom_cap_mod::initializeadvertise) phase, calls are +!! During the [InitializeAdvertise] (@ref MOM_cap_mod::initializeadvertise) phase, calls are !! made to MOM's native initialization subroutines, including `fms_init()`, `constants_init()`, !! `field_manager_init()`, `diag_manager_init()`, and `set_calendar_type()`. The MPI communicator !! is pulled in through the ESMF VM object for the MOM component. The dt and start time are set @@ -121,7 +121,7 @@ !! !! @subsection Run Run !! -!! The [ModelAdvance] (@ref mom_cap_mod::modeladvance) subroutine is called by the NUOPC +!! The [ModelAdvance] (@ref MOM_cap_mod::modeladvance) subroutine is called by the NUOPC !! infrastructure when it's time for MOM to advance in time. During this subroutine, there is a !! call into the MOM update routine: !! @@ -184,7 +184,7 @@ !! \f] !! @subsection Finalization Finalization !! -!! NUOPC infrastructure calls [ocean_model_finalize] (@ref mom_cap_mod::ocean_model_finalize) +!! NUOPC infrastructure calls [ocean_model_finalize] (@ref MOM_cap_mod::ocean_model_finalize) !! at the end of the run. This subroutine is a hook to call into MOM's native shutdown !! procedures: !! @@ -272,11 +272,11 @@ !! so that it can maintain state there if desired. !! The member of type `ice_ocean_boundary_type` is populated by this cap !! with incoming coupling fields from other components. These three derived types are allocated during the -!! [InitializeAdvertise] (@ref mom_cap_mod::initializeadvertise) phase. Also during that +!! [InitializeAdvertise] (@ref MOM_cap_mod::initializeadvertise) phase. Also during that !! phase, the `ice_ocean_boundary` type members are all allocated using bounds retrieved !! from `mpp_get_compute_domain()`. !! -!! During the [InitializeRealize] (@ref mom_cap_mod::initializerealize) phase, +!! During the [InitializeRealize] (@ref MOM_cap_mod::initializerealize) phase, !! `ESMF_Field`s are created for each of the coupling fields in the `ice_ocean_boundary` !! and `ocean_public_type` members of the internal state. These fields directly reference into the members of !! the `ice_ocean_boundary` and `ocean_public_type` so that memory-to-memory copies are not required to move @@ -289,7 +289,7 @@ !! "DumpFields" has been set to "true". In this case the cap will write out NetCDF files !! with names "field_ocn_import_.nc" and "field_ocn_export_.nc". !! Additionally, calls will be made to the cap subroutine [dumpMomInternal] -!! (@ref mom_cap_mod::dumpmominternal) to write out model internal fields to files +!! (@ref MOM_cap_mod::dumpmominternal) to write out model internal fields to files !! named "field_ocn_internal_.nc". In all cases these NetCDF files will !! contain a time series of field data. !! @@ -303,7 +303,7 @@ !! * `DumpFields` - when set to "true", write out diagnostic NetCDF files for import/export/internal fields !! * `ProfileMemory` - when set to "true", write out memory usage information to the ESMF log files; this !! information is written when entering and leaving the [ModelAdvance] -!! (@ref mom_cap_mod::modeladvance) subroutine and before and after the call to +!! (@ref MOM_cap_mod::modeladvance) subroutine and before and after the call to !! `update_ocean_model()`. !! * `restart_interval` - integer number of seconds indicating the interval at !! which to call `ocean_model_restart()`; no restarts written if set to 0 @@ -311,7 +311,7 @@ !! !> This module contains a set of subroutines that are required by NUOPC. -module mom_cap_mod +module MOM_cap_mod use constants_mod, only: constants_init use diag_manager_mod, only: diag_manager_init, diag_manager_end use field_manager_mod, only: field_manager_init, field_manager_end @@ -340,13 +340,13 @@ module mom_cap_mod use MOM_get_input, only: Get_MOM_Input, directories use MOM_domains, only: pass_var use MOM_error_handler, only: is_root_pe -use MOM_ocean_model, only: ice_ocean_boundary_type +use MOM_ocean_model_nuopc, only: ice_ocean_boundary_type use MOM_grid, only: ocean_grid_type, get_global_grid_size -use MOM_ocean_model, only: ocean_model_restart, ocean_public_type, ocean_state_type -use MOM_ocean_model, only: ocean_model_init_sfc -use MOM_ocean_model, only: ocean_model_init, update_ocean_model, ocean_model_end, get_ocean_grid -use mom_cap_time, only: AlarmInit -use mom_cap_methods, only: mom_import, mom_export, mom_set_geomtype +use MOM_ocean_model_nuopc, only: ocean_model_restart, ocean_public_type, ocean_state_type +use MOM_ocean_model_nuopc, only: ocean_model_init_sfc +use MOM_ocean_model_nuopc, only: ocean_model_init, update_ocean_model, ocean_model_end, get_ocean_grid +use MOM_cap_time, only: AlarmInit +use MOM_cap_methods, only: mom_import, mom_export, mom_set_geomtype #ifdef CESMCOUPLED use shr_file_mod, only: shr_file_setLogUnit, shr_file_getLogUnit #endif @@ -465,7 +465,7 @@ subroutine SetServices(gcomp, rc) integer, intent(out) :: rc !< return code ! local variables - character(len=*),parameter :: subname='(mom_cap:SetServices)' + character(len=*),parameter :: subname='(MOM_cap:SetServices)' rc = ESMF_SUCCESS @@ -559,7 +559,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) logical :: isPresent, isSet integer :: iostat character(len=64) :: value, logmsg - character(len=*),parameter :: subname='(mom_cap:InitializeP0)' + character(len=*),parameter :: subname='(MOM_cap:InitializeP0)' rc = ESMF_SUCCESS @@ -581,7 +581,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) if (isPresent .and. isSet) write_diagnostics=(trim(value)=="true") write(logmsg,*) write_diagnostics - call ESMF_LogWrite('mom_cap:DumpFields = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:DumpFields = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -596,7 +596,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) return if (isPresent .and. isSet) profile_memory=(trim(value)=="true") write(logmsg,*) profile_memory - call ESMF_LogWrite('mom_cap:ProfileMemory = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:ProfileMemory = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -611,7 +611,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) return if (isPresent .and. isSet) grid_attach_area=(trim(value)=="true") write(logmsg,*) grid_attach_area - call ESMF_LogWrite('mom_cap:GridAttachArea = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:GridAttachArea = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -626,7 +626,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) return if (isPresent .and. isSet) then scalar_field_name = trim(value) - call ESMF_LogWrite('mom_cap:ScalarFieldName = '//trim(scalar_field_name), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:ScalarFieldName = '//trim(scalar_field_name), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -649,7 +649,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) return endif write(logmsg,*) scalar_field_count - call ESMF_LogWrite('mom_cap:ScalarFieldCount = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:ScalarFieldCount = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -672,7 +672,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) return endif write(logmsg,*) scalar_field_idx_grid_nx - call ESMF_LogWrite('mom_cap:ScalarFieldIdxGridNX = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:ScalarFieldIdxGridNX = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -695,7 +695,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) return endif write(logmsg,*) scalar_field_idx_grid_ny - call ESMF_LogWrite('mom_cap:ScalarFieldIdxGridNY = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:ScalarFieldIdxGridNY = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -755,7 +755,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) logical :: existflag integer :: userRc character(len=512) :: restartfile ! Path/Name of restart file - character(len=*), parameter :: subname='(mom_cap:InitializeAdvertise)' + character(len=*), parameter :: subname='(MOM_cap:InitializeAdvertise)' character(len=32) :: calendar !-------------------------------- @@ -890,7 +890,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if (isPresent .and. isSet) then read(cvalue,*) starttype else - call ESMF_LogWrite('mom_cap:start_type unset - using input.nml for restart option', & + call ESMF_LogWrite('MOM_cap:start_type unset - using input.nml for restart option', & ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & @@ -913,7 +913,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) endif if (len_trim(runtype) > 0) then - call ESMF_LogWrite('mom_cap:startup = '//trim(runtype), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap:startup = '//trim(runtype), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -938,7 +938,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) file=__FILE__)) & return ! bail out if (existflag) then - call ESMF_LogWrite('mom_cap: called user GetRestartFileToRead', ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap: called user GetRestartFileToRead', ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -953,13 +953,13 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) return if (isPresent .and. isSet) then restartfile = trim(cvalue) - call ESMF_LogWrite('mom_cap: RestartFileToRead = '//trim(restartfile), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite('MOM_cap: RestartFileToRead = '//trim(restartfile), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & return else - call ESMF_LogWrite('mom_cap: restart requested, no RestartFileToRead attribute provided-will use input.nml',& + call ESMF_LogWrite('MOM_cap: restart requested, no RestartFileToRead attribute provided-will use input.nml',& ESMF_LOGMSG_WARNING, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & @@ -1159,7 +1159,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) integer, allocatable :: gindex(:) ! global index space character(len=128) :: fldname character(len=256) :: cvalue - character(len=*), parameter :: subname='(mom_cap:InitializeRealize)' + character(len=*), parameter :: subname='(MOM_cap:InitializeRealize)' !-------------------------------- rc = ESMF_SUCCESS @@ -1637,7 +1637,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) endif !--------------------------------- - ! Set module variable geomtype in mom_cap_methods + ! Set module variable geomtype in MOM_cap_methods !--------------------------------- call mom_set_geomtype(geomtype) @@ -1674,7 +1674,7 @@ subroutine DataInitialize(gcomp, rc) integer :: fieldCount, n type(ESMF_Field) :: field character(len=64),allocatable :: fieldNameList(:) - character(len=*),parameter :: subname='(mom_cap:DataInitialize)' + character(len=*),parameter :: subname='(MOM_cap:DataInitialize)' !-------------------------------- ! query the Component for its clock, importState and exportState @@ -1788,7 +1788,7 @@ subroutine ModelAdvance(gcomp, rc) integer :: seconds, day, year, month, hour, minute character(ESMF_MAXSTR) :: restartname, cvalue character(240) :: msgString - character(len=*),parameter :: subname='(mom_cap:ModelAdvance)' + character(len=*),parameter :: subname='(MOM_cap:ModelAdvance)' rc = ESMF_SUCCESS if(profile_memory) call ESMF_VMLogMemInfo("Entering MOM Model_ADVANCE: ") @@ -1978,7 +1978,7 @@ subroutine ModelAdvance(gcomp, rc) file=__FILE__)) & return ! bail out if (existflag) then - call ESMF_LogWrite("mom_cap: called user GetRestartFileToWrite method", ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite("MOM_cap: called user GetRestartFileToWrite method", ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -1991,7 +1991,7 @@ subroutine ModelAdvance(gcomp, rc) return ! bail out if (isPresent .and. isSet) then restartname = trim(cvalue) - call ESMF_LogWrite("mom_cap: User RestartFileToWrite: "//trim(restartname), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite("MOM_cap: User RestartFileToWrite: "//trim(restartname), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -2014,7 +2014,7 @@ subroutine ModelAdvance(gcomp, rc) return ! bail out write(restartname,'(A,".mom6.r.",I4.4,"-",I2.2,"-",I2.2,"-",I2.2,"-",I2.2,"-",I2.2)') & "ocn", year, month, day, hour, minute, seconds - call ESMF_LogWrite("mom_cap: Using default restart filename: "//trim(restartname), ESMF_LOGMSG_INFO, rc=rc) + call ESMF_LogWrite("MOM_cap: Using default restart filename: "//trim(restartname), ESMF_LOGMSG_INFO, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & @@ -2084,7 +2084,7 @@ subroutine ModelSetRunClock(gcomp, rc) type(ESMF_ALARM) :: restart_alarm logical :: isPresent, isSet logical :: first_time = .true. - character(len=*),parameter :: subname='mom_cap:(ModelSetRunClock) ' + character(len=*),parameter :: subname='MOM_cap:(ModelSetRunClock) ' !-------------------------------- rc = ESMF_SUCCESS @@ -2247,7 +2247,7 @@ subroutine ocean_model_finalize(gcomp, rc) type(ESMF_Clock) :: clock type(ESMF_Time) :: currTime character(len=64) :: timestamp - character(len=*),parameter :: subname='(mom_cap:ocean_model_finalize)' + character(len=*),parameter :: subname='(MOM_cap:ocean_model_finalize)' write(*,*) 'MOM: --- finalize called ---' rc = ESMF_SUCCESS @@ -2302,7 +2302,7 @@ subroutine State_SetScalar(value, scalar_id, State, mytask, scalar_name, scalar_ ! local variables type(ESMF_Field) :: field real(ESMF_KIND_R8), pointer :: farrayptr(:,:) - character(len=*), parameter :: subname='(mom_cap:State_SetScalar)' + character(len=*), parameter :: subname='(MOM_cap:State_SetScalar)' !-------------------------------------------------------- rc = ESMF_SUCCESS @@ -2343,7 +2343,7 @@ subroutine MOM_RealizeFields(state, nfields, field_defs, tag, grid, mesh, rc) type(ESMF_Field) :: field real(ESMF_KIND_R8), pointer :: fldptr1d(:) ! for mesh real(ESMF_KIND_R8), pointer :: fldptr2d(:,:) ! for grid - character(len=*),parameter :: subname='(mom_cap:MOM_RealizeFields)' + character(len=*),parameter :: subname='(MOM_cap:MOM_RealizeFields)' !-------------------------------------------------------- rc = ESMF_SUCCESS @@ -2448,7 +2448,7 @@ subroutine SetScalarField(field, rc) ! local variables type(ESMF_Distgrid) :: distgrid type(ESMF_Grid) :: grid - character(len=*), parameter :: subname='(mom_cap:SetScalarField)' + character(len=*), parameter :: subname='(MOM_cap:SetScalarField)' rc = ESMF_SUCCESS @@ -2489,7 +2489,7 @@ subroutine fld_list_add(num, fldlist, stdname, transferOffer, shortname) ! local variables integer :: rc - character(len=*), parameter :: subname='(mom_cap:fld_list_add)' + character(len=*), parameter :: subname='(MOM_cap:fld_list_add)' ! fill in the new entry num = num + 1 @@ -2525,4 +2525,4 @@ subroutine shr_file_getLogUnit(nunit) end subroutine shr_file_getLogUnit #endif -end module mom_cap_mod +end module MOM_cap_mod diff --git a/config_src/nuopc_driver/mom_cap_methods.F90 b/config_src/nuopc_driver/mom_cap_methods.F90 index 8d9543137a..8cb1a2ca4c 100644 --- a/config_src/nuopc_driver/mom_cap_methods.F90 +++ b/config_src/nuopc_driver/mom_cap_methods.F90 @@ -1,25 +1,25 @@ !> Contains import/export methods for both NEMS and CMEPS. -module mom_cap_methods - -use ESMF, only: ESMF_Clock, ESMF_ClockGet, ESMF_time, ESMF_TimeGet -use ESMF, only: ESMF_TimeInterval, ESMF_TimeIntervalGet -use ESMF, only: ESMF_State, ESMF_StateGet -use ESMF, only: ESMF_Field, ESMF_FieldGet, ESMF_FieldCreate -use ESMF, only: ESMF_GridComp, ESMF_Mesh, ESMF_Grid, ESMF_GridCreate -use ESMF, only: ESMF_DistGrid, ESMF_DistGridCreate -use ESMF, only: ESMF_KIND_R8, ESMF_SUCCESS, ESMF_LogFoundError -use ESMF, only: ESMF_LOGERR_PASSTHRU, ESMF_LOGMSG_INFO, ESMF_LOGWRITE -use ESMF, only: ESMF_LogSetError, ESMF_RC_MEM_ALLOCATE -use ESMF, only: ESMF_StateItem_Flag, ESMF_STATEITEM_NOTFOUND -use ESMF, only: ESMF_GEOMTYPE_FLAG, ESMF_GEOMTYPE_GRID, ESMF_GEOMTYPE_MESH -use ESMF, only: ESMF_RC_VAL_OUTOFRANGE, ESMF_INDEX_DELOCAL, ESMF_MESHLOC_ELEMENT -use ESMF, only: ESMF_TYPEKIND_R8 -use ESMF, only: operator(/=), operator(==) -use MOM_ocean_model, only: ocean_public_type, ocean_state_type -use MOM_surface_forcing, only: ice_ocean_boundary_type -use MOM_grid, only: ocean_grid_type -use MOM_domains, only: pass_var -use mpp_domains_mod, only: mpp_get_compute_domain +module MOM_cap_methods + +use ESMF, only: ESMF_Clock, ESMF_ClockGet, ESMF_time, ESMF_TimeGet +use ESMF, only: ESMF_TimeInterval, ESMF_TimeIntervalGet +use ESMF, only: ESMF_State, ESMF_StateGet +use ESMF, only: ESMF_Field, ESMF_FieldGet, ESMF_FieldCreate +use ESMF, only: ESMF_GridComp, ESMF_Mesh, ESMF_Grid, ESMF_GridCreate +use ESMF, only: ESMF_DistGrid, ESMF_DistGridCreate +use ESMF, only: ESMF_KIND_R8, ESMF_SUCCESS, ESMF_LogFoundError +use ESMF, only: ESMF_LOGERR_PASSTHRU, ESMF_LOGMSG_INFO, ESMF_LOGWRITE +use ESMF, only: ESMF_LogSetError, ESMF_RC_MEM_ALLOCATE +use ESMF, only: ESMF_StateItem_Flag, ESMF_STATEITEM_NOTFOUND +use ESMF, only: ESMF_GEOMTYPE_FLAG, ESMF_GEOMTYPE_GRID, ESMF_GEOMTYPE_MESH +use ESMF, only: ESMF_RC_VAL_OUTOFRANGE, ESMF_INDEX_DELOCAL, ESMF_MESHLOC_ELEMENT +use ESMF, only: ESMF_TYPEKIND_R8 +use ESMF, only: operator(/=), operator(==) +use MOM_ocean_model_nuopc, only: ocean_public_type, ocean_state_type +use MOM_surface_forcing_nuopc, only: ice_ocean_boundary_type +use MOM_grid, only: ocean_grid_type +use MOM_domains, only: pass_var +use mpp_domains_mod, only: mpp_get_compute_domain ! By default make data private implicit none; private @@ -646,7 +646,7 @@ subroutine State_GetFldPtr_1d(State, fldname, fldptr, rc) ! local variables type(ESMF_Field) :: lfield integer :: lrc - character(len=*),parameter :: subname='(mom_cap:State_GetFldPtr)' + character(len=*),parameter :: subname='(MOM_cap:State_GetFldPtr)' call ESMF_StateGet(State, itemName=trim(fldname), field=lfield, rc=lrc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & @@ -673,7 +673,7 @@ subroutine State_GetFldPtr_2d(State, fldname, fldptr, rc) ! local variables type(ESMF_Field) :: lfield integer :: lrc - character(len=*),parameter :: subname='(mom_cap:State_GetFldPtr)' + character(len=*),parameter :: subname='(MOM_cap:State_GetFldPtr)' call ESMF_StateGet(State, itemName=trim(fldname), field=lfield, rc=lrc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & @@ -712,7 +712,7 @@ subroutine State_GetImport(state, fldname, isc, iec, jsc, jec, output, do_sum, r integer :: lbnd1,lbnd2 real(ESMF_KIND_R8), pointer :: dataPtr1d(:) real(ESMF_KIND_R8), pointer :: dataPtr2d(:,:) - character(len=*) , parameter :: subname='(mom_cap_methods:state_getimport)' + character(len=*) , parameter :: subname='(MOM_cap_methods:state_getimport)' ! ---------------------------------------------- rc = ESMF_SUCCESS @@ -793,7 +793,7 @@ subroutine State_SetExport(state, fldname, isc, iec, jsc, jec, input, ocean_grid integer :: lbnd1,lbnd2 real(ESMF_KIND_R8), pointer :: dataPtr1d(:) real(ESMF_KIND_R8), pointer :: dataPtr2d(:,:) - character(len=*) , parameter :: subname='(mom_cap_methods:state_setexport)' + character(len=*) , parameter :: subname='(MOM_cap_methods:state_setexport)' ! ---------------------------------------------- rc = ESMF_SUCCESS @@ -850,4 +850,4 @@ subroutine State_SetExport(state, fldname, isc, iec, jsc, jec, input, ocean_grid end subroutine State_SetExport -end module mom_cap_methods +end module MOM_cap_methods diff --git a/config_src/nuopc_driver/mom_cap_time.F90 b/config_src/nuopc_driver/mom_cap_time.F90 index 3f36a131f9..daf9889c43 100644 --- a/config_src/nuopc_driver/mom_cap_time.F90 +++ b/config_src/nuopc_driver/mom_cap_time.F90 @@ -4,7 +4,7 @@ !! determine if/how these could be offered more generally in a !! shared library. For now we really want the MOM cap to only !! depend on MOM and ESMF/NUOPC. -module mom_cap_time +module MOM_cap_time ! !USES: use ESMF , only : ESMF_Time, ESMF_Clock, ESMF_Calendar, ESMF_Alarm @@ -405,4 +405,4 @@ subroutine date2ymd (date, year, month, day) end subroutine date2ymd -end module +end module MOM_cap_time diff --git a/config_src/nuopc_driver/MOM_ocean_model.F90 b/config_src/nuopc_driver/mom_ocean_model_nuopc.F90 similarity index 99% rename from config_src/nuopc_driver/MOM_ocean_model.F90 rename to config_src/nuopc_driver/mom_ocean_model_nuopc.F90 index f0ba14ac1d..95b1bcc6e3 100644 --- a/config_src/nuopc_driver/MOM_ocean_model.F90 +++ b/config_src/nuopc_driver/mom_ocean_model_nuopc.F90 @@ -1,5 +1,5 @@ !> Top-level module for the MOM6 ocean model in coupled mode. -module MOM_ocean_model +module MOM_ocean_model_nuopc ! This file is part of MOM6. See LICENSE.md for the license. @@ -35,10 +35,6 @@ module MOM_ocean_model use MOM_marine_ice, only : iceberg_forces, iceberg_fluxes, marine_ice_init, marine_ice_CS use MOM_restart, only : MOM_restart_CS, save_restart use MOM_string_functions, only : uppercase -use MOM_surface_forcing, only : surface_forcing_init, convert_IOB_to_fluxes -use MOM_surface_forcing, only : convert_IOB_to_forces, ice_ocn_bnd_type_chksum -use MOM_surface_forcing, only : ice_ocean_boundary_type, surface_forcing_CS -use MOM_surface_forcing, only : forcing_save_restart use MOM_time_manager, only : time_type, get_time, set_time, operator(>) use MOM_time_manager, only : operator(+), operator(-), operator(*), operator(/) use MOM_time_manager, only : operator(/=), operator(<=), operator(>=) @@ -62,6 +58,10 @@ module MOM_ocean_model use MOM_EOS, only : gsw_sp_from_sr, gsw_pt_from_ct use MOM_wave_interface, only: wave_parameters_CS, MOM_wave_interface_init use MOM_wave_interface, only: MOM_wave_interface_init_lite, Update_Surface_Waves +use MOM_surface_forcing_nuopc, only : surface_forcing_init, convert_IOB_to_fluxes +use MOM_surface_forcing_nuopc, only : convert_IOB_to_forces, ice_ocn_bnd_type_chksum +use MOM_surface_forcing_nuopc, only : ice_ocean_boundary_type, surface_forcing_CS +use MOM_surface_forcing_nuopc, only : forcing_save_restart #include @@ -475,7 +475,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, & integer :: secs, days integer :: is, ie, js, je - call callTree_enter("update_ocean_model(), MOM_ocean_model.F90") + call callTree_enter("update_ocean_model(), MOM_ocean_model_nuopc.F90") call get_time(Ocean_coupling_time_step, secs, days) dt_coupling = 86400.0*real(days) + real(secs) @@ -1174,4 +1174,4 @@ subroutine get_ocean_grid(OS, Gridp) return end subroutine get_ocean_grid -end module MOM_ocean_model +end module MOM_ocean_model_nuopc diff --git a/config_src/nuopc_driver/MOM_surface_forcing.F90 b/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 similarity index 99% rename from config_src/nuopc_driver/MOM_surface_forcing.F90 rename to config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 index 26121ff62d..b6517de9e4 100644 --- a/config_src/nuopc_driver/MOM_surface_forcing.F90 +++ b/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 @@ -1,5 +1,5 @@ !> Converts the input ESMF data (import data) to a MOM-specific data type (surface_forcing_CS). -module MOM_surface_forcing +module MOM_surface_forcing_nuopc ! This file is part of MOM6. See LICENSE.md for the license. @@ -1011,7 +1011,7 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, restore_salt, character(len=200) :: TideAmp_file, gust_file, salt_file, temp_file ! Input file names. ! This include declares and sets the variable "version". #include "version_variable.h" - character(len=40) :: mdl = "MOM_surface_forcing" ! This module's name. + character(len=40) :: mdl = "MOM_surface_forcing_nuopc" ! This module's name. character(len=48) :: stagger character(len=48) :: flnam character(len=240) :: basin_file @@ -1383,4 +1383,4 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt) end subroutine ice_ocn_bnd_type_chksum -end module MOM_surface_forcing +end module MOM_surface_forcing_nuopc diff --git a/config_src/nuopc_driver/ocn_comp_NUOPC.F90 b/config_src/nuopc_driver/ocn_comp_NUOPC.F90 new file mode 100644 index 0000000000..6d25b9a1ae --- /dev/null +++ b/config_src/nuopc_driver/ocn_comp_NUOPC.F90 @@ -0,0 +1,3 @@ +module ocn_comp_NUOPC + use MOM_cap_mod +end module ocn_comp_NUOPC diff --git a/config_src/nuopc_driver/ocn_comp_nuopc.F90 b/config_src/nuopc_driver/ocn_comp_nuopc.F90 deleted file mode 100644 index 51b8a85c26..0000000000 --- a/config_src/nuopc_driver/ocn_comp_nuopc.F90 +++ /dev/null @@ -1,3 +0,0 @@ -module ocn_comp_nuopc - use mom_cap_mod -end module ocn_comp_nuopc