Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A "spec" file for SetServices of GEOS_OceanGridComp.F90 #4

Closed
sanAkel opened this issue Jun 2, 2022 · 2 comments
Closed

A "spec" file for SetServices of GEOS_OceanGridComp.F90 #4

sanAkel opened this issue Jun 2, 2022 · 2 comments
Assignees
Labels
0 diff structural Structural changes to repository that are zero-diff enhancement New feature or request

Comments

@sanAkel
Copy link
Collaborator

sanAkel commented Jun 2, 2022

This issue proposes an enhancement in the form of a clean up of the long SetServices in https://github.com/GEOS-ESM/GEOS_OceanGridComp/blob/develop/GEOS_OceanGridComp.F90

The list of imports, exports and (one) internal variable is:

call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'FROCEAN', &
LONG_NAME = 'fraction_of_gridbox_covered_by_ocean',&
UNITS = '1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'TAUX', &
LONG_NAME = 'Agrid_eastward_stress_on_ocean', &
UNITS = 'N m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'TAUY', &
LONG_NAME = 'Agrid_northward_stress_on_ocean', &
UNITS = 'N m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'PENUVR', &
LONG_NAME = 'net_downward_penetrating_direct_UV_flux', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'PENPAR', &
LONG_NAME = 'net_downward_penetrating_direct_PAR_flux', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'PENUVF', &
LONG_NAME = 'net_downward_penetrating_diffuse_UV_flux', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'PENPAF', &
LONG_NAME = 'net_downward_penetrating_diffuse_PAR_flux', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'net_surface_downwelling_nir_beam_flux',&
UNITS = 'W m-2' ,&
SHORT_NAME = 'DRNIR' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'net_surface_downwelling_nir_diffuse_flux',&
UNITS = 'W m-2' ,&
SHORT_NAME = 'DFNIR' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'SWHEAT', &
LONG_NAME = 'solar_heating_rate', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'river_discharge_at_ocean_points',&
UNITS = 'kg m-2 s-1' ,&
SHORT_NAME = 'DISCHARGE' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
if (trim(OCEAN_NAME) == "MOM") then
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'TR', &
LONG_NAME = 'tracer_mixing_ratios', &
UNITS = '1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'TRFLUX', &
LONG_NAME = 'surface_fluxes_of_tracers', &
UNITS = 'X', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
endif
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'surface_net_downward_longwave_flux',&
UNITS = 'W m-2', &
SHORT_NAME = 'LWFLX' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'upward_sensible_heat_flux' ,&
UNITS = 'W m-2', &
SHORT_NAME = 'SHFLX' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'evaporation' ,&
UNITS = 'kg m-2 s-1' ,&
SHORT_NAME = 'QFLUX' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'ocean_snowfall' ,&
UNITS = 'kg m-2 s-1' ,&
SHORT_NAME = 'SNOW' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
LONG_NAME = 'ocean_rainfall' ,&
UNITS = 'kg m-2 s-1' ,&
SHORT_NAME = 'RAIN' ,&
DIMS = MAPL_DimsHorzOnly ,&
VLOCATION = MAPL_VLocationNone ,&
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'FRESH', &
LONG_NAME = 'fresh_water_flux_due_to_ice_dynamics', &
UNITS = 'kg m-2 s-1' ,&
DIMS = MAPL_DimsHorzOnly ,&
VLOCATION = MAPL_VLocationNone ,&
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'FSALT', &
LONG_NAME = 'salt_flux_due_to_ice_dynamics', &
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'FHOCN', &
LONG_NAME = 'heat_flux_due_to_ice_dynamics', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'PEN_OCN', &
LONG_NAME = 'penetrated_shortwave_flux_at_the_bottom_of_first_ocean_model_layer', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
if (dual_ocean) then
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'FRACICEd', &
LONG_NAME = 'fractional_cover_of_seaice', &
UNITS = '1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
endif
! ! Need to have this internal state to fill in orphan points:
call MAPL_AddInternalSpec(GC, &
SHORT_NAME = 'TS_FOUND', &
LONG_NAME = 'foundation_temperature_for_interface_layer',&
UNITS = 'K', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
FRIENDLYTO = trim(COMP_NAME), &
DEFAULT = 280.0, &
RC=STATUS )
VERIFY_(STATUS)
!ALT Note the FRACICE from datasea is inhereted (in AMIP or dual_ocean)
! !EXPORT STATE:
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'MASKO', &
LONG_NAME = 'ocean_mask', &
UNITS = '1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SS_FOUND', &
LONG_NAME = 'foundation_salinity_for_interface_layer',&
UNITS = 'PSU', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'FRZMLT', &
LONG_NAME = 'freeze_melt_potential', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
! Diagnostics exports
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'TAUX', &
LONG_NAME = 'Agrid_eastward_stress_on_ocean', &
UNITS = 'N m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'TAUY', &
LONG_NAME = 'Agrid_northward_stress_on_ocean', &
UNITS = 'N m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SWHEAT', &
LONG_NAME = 'solar_heating_rate', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'RFLUX', &
LONG_NAME = 'downward_radiative_heat_flux_at_ocean_bottom',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
LONG_NAME = 'river_discharge_at_ocean_points',&
UNITS = 'kg m-2 s-1' ,&
SHORT_NAME = 'DISCHARGE' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'FROCEAN', &
LONG_NAME = 'fraction_of_gridbox_covered_by_ocean',&
UNITS = '1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
LONG_NAME = 'surface_net_downward_longwave_flux',&
UNITS = 'W m-2' ,&
SHORT_NAME = 'LWFLX' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
LONG_NAME = 'surface_net_downward_shortwave_flux',&
UNITS = 'W m-2' ,&
SHORT_NAME = 'SWFLX' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
LONG_NAME = 'upward_sensible_heat_flux' ,&
UNITS = 'W m-2', &
SHORT_NAME = 'SHFLX' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
LONG_NAME = 'evaporation' ,&
UNITS = 'kg m-2 s-1' ,&
SHORT_NAME = 'QFLUX' ,&
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SFLX', &
LONG_NAME = 'salt_flux_due_to_ice_dynamics', &
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'RAIN', &
LONG_NAME = 'ocean_rainfall',&
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SNOW', &
LONG_NAME = 'ocean_snowfall',&
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'PEN_OCN', &
LONG_NAME = 'penetrated_shortwave_flux_at_the_bottom_of_first_ocean_model_layer',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
! Exports of child
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'TW', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'SW', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'UW', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'VW', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
if(DO_DATASEA==0) then
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'DH', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'UWB', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'VWB', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
if (trim(OCEAN_NAME) == "MOM") then
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'SSH', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
endif
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'SLV', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
if (trim(OCEAN_NAME) == "MOM") then
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'PBO', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
endif
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'T', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'S', &
CHILD_ID = OCN, &
RC=STATUS )
VERIFY_(STATUS)
end if

Note:
Few fields are conditional to MOM (=MOM5), DO_DATASEA and DUAL_OCEAN; strictly speaking DUAL_OCEAN must be nested within MOM. I intend to package all DUAL_OCEAN logic into a subroutine in a later issue.

For testing this change, please set up a coupled model experiment using gcm_setup and let myself and/or @mathomp4 know so we can supply a set of restarts. The recommended set up is C12 x 5deg (atmosphere x ocean resolutions). This change should not change answers.

If there are any questions, please reach out. Thanks!

@sanAkel sanAkel added 0 diff structural Structural changes to repository that are zero-diff enhancement New feature or request labels Jun 2, 2022
@darianboggs
Copy link
Contributor

Pull request created

@sanAkel
Copy link
Collaborator Author

sanAkel commented Dec 24, 2022

#6 closes it.

@sanAkel sanAkel closed this as completed Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff structural Structural changes to repository that are zero-diff enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants