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

Dev master candidate NCAR 03/27/2020 #1081

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
576fafb
Initial commit for implementing near-surface mixing
ashao Sep 4, 2019
654a12c
Add additional unit tests for bulk method
ashao Sep 9, 2019
8385231
Add function and unit tests for boundary layer mixing
ashao Sep 9, 2019
6677820
Updates layer_fluxes_bulk_method and bulk_average
gustavo-marques Sep 10, 2019
17385cc
Removes trailing space and fixes line length exceeded
gustavo-marques Sep 10, 2019
a36f5d6
Removes more trailing space
gustavo-marques Sep 10, 2019
f87aaa2
Fixes bulk_average calculation and takes into account partial cells w…
gustavo-marques Sep 11, 2019
79bea68
New unit tests for surface boundary fluxes
ashao Sep 12, 2019
4e63c75
Update API for boundary_layer_fluxes unit tests
ashao Sep 12, 2019
2b10a8b
Skeleton for boundary layer mixing interfaces
ashao Sep 12, 2019
a4dbeb1
Hook in lateral boundary mixing initialization
ashao Sep 13, 2019
ae6529e
Hook lateral boundary mixing into tracer_hor_diff
ashao Sep 13, 2019
df938a1
Add masking in lateral_boundary_fluxes
ashao Sep 13, 2019
8a4ed84
Guard against case where the boundary layer is 0 on one column
ashao Sep 13, 2019
8ab7aa8
Convert diffusive flux convergence to a change in tracer
ashao Sep 13, 2019
9b4d2c2
Only allocate KPP_CS if requested
ashao Sep 14, 2019
e5f96f4
Fix minor bugs in lateral boundary mixing
ashao Sep 14, 2019
332a264
Try to restore commits from accidental move of file
ashao Sep 14, 2019
322aa77
Rename MOM_boundary_lateral_mixing.F90 for consistency
ashao Sep 14, 2019
223a815
Merge branch 'near_surface_fluxes' of github.com:ashao/MOM6 into HEAD
ashao Sep 14, 2019
915bcb1
Diagnostics for lateral boundary mixing scheme
ashao Sep 14, 2019
f6800c2
Update halos for hbl in LBM
Sep 14, 2019
4d0aed6
Fixes units and moves bulk diags inside if statement
gustavo-marques Sep 16, 2019
3bb1f55
Adding first version of LBM method=2
gustavo-marques Sep 16, 2019
8d9c6a4
Merge branch 'dev/ncar' into near_surface_fluxes
gustavo-marques Sep 17, 2019
62e3227
Adding layer by layer method for bottom boundary
gustavo-marques Sep 17, 2019
3cb68d3
Adds missing arguments after merge
gustavo-marques Sep 17, 2019
6d6d3b8
Adds two unit tests for layer by layer method
gustavo-marques Sep 17, 2019
c41b8b0
Adds two unit tests for layer by layer method
gustavo-marques Sep 17, 2019
f38a369
Fixes unit test for layer by layer and removes the hbl_min = MIN(hbl_…
gustavo-marques Sep 17, 2019
e5645b1
Fixes line length exceeding 120
gustavo-marques Sep 17, 2019
4d5c786
Fixes undoxygenized LBM module variables
gustavo-marques Sep 17, 2019
73d0d78
Fixes a bug in method2 of LBM, where diffusivities were not used
gustavo-marques Sep 19, 2019
a4f9550
Added new equilibrium formula for MEKE
gustavo-marques Sep 19, 2019
66a8f0a
Fix bug in LBM diagnostics and add diags
gustavo-marques Sep 19, 2019
bb46c38
Calculates bottomFac2 IF CS%MEKE_GEOMETRIC=True
gustavo-marques Sep 23, 2019
bcec94c
Merge branch 'dev/ncar' into fix_MEKE_GM_src
gustavo-marques Sep 23, 2019
c880539
Update LBM flux names and fix posting of 2d diags
Sep 23, 2019
9f15e4f
Adds new unit test and fixes diagnostics
gustavo-marques Sep 24, 2019
5aaf34b
Add flux limiter for bulk layer fluxes
gustavo-marques Sep 25, 2019
ca23e66
Make fluxes_bulk_method more roundoff safe
ashao Sep 25, 2019
91ca2d1
Fix flux limiter in LBM when < 0
ashao Sep 26, 2019
3c5c7d1
Merge branch 'rewrite_discontinuous_sort' into near_surface_fluxes
gustavo-marques Sep 26, 2019
82c1bca
First set of commits to limit neutral diffusion to the interior
gustavo-marques Sep 26, 2019
d7da982
Improves the calculation of F_bulk to minimize roundoff errors
gustavo-marques Sep 26, 2019
e806fba
Fixes a bug in the bulk_method
gustavo-marques Sep 26, 2019
af41095
Fix uninitialized variables in find_surface when NDIFF_INTERIOR_ONLY …
ashao Sep 26, 2019
69ec18c
Removes redundant statement in netrual diffusion
gustavo-marques Sep 27, 2019
5583f84
Renames lateral_boundary_mixing to lateral_boundary_diffusion
gustavo-marques Sep 27, 2019
8f3cf96
Add placeholders for adding method3 and applying filter on method1
gustavo-marques Sep 27, 2019
15c9f06
Hard-code min of SN to be 1.0e-7
gustavo-marques Oct 2, 2019
486da1d
Replaces trunit to conc in the documentation
gustavo-marques Oct 4, 2019
839217d
Rearranged MEKE_EQUILIBRIUM subroutine
gustavo-marques Oct 15, 2019
bb785a8
Adds option to scale KHTH with depth
gustavo-marques Oct 14, 2019
67016eb
Reverts description in DO_DYNAMICS to older version as this was chang…
gustavo-marques Oct 16, 2019
223037c
Deletes unneeded variables from calc_depth_function
gustavo-marques Oct 16, 2019
1522ad0
Minor changes in the doxygen comments
gustavo-marques Oct 16, 2019
ebf5ee0
Adds MEKE_equilibrium_restoring
gustavo-marques Oct 15, 2019
2bb321e
Merge pull request #127 from gustavo-marques/depth_scaled_khth
alperaltuntas Oct 16, 2019
3f041d9
MEKE diagnostic array fixes
marshallward Oct 3, 2019
050aa31
Moves allocation of CS%equilibrium_value inside subroutine MEKE_equil…
gustavo-marques Oct 23, 2019
462768b
Merge pull request #128 from gustavo-marques/fix_MEKE_GM_src
alperaltuntas Oct 23, 2019
80743e6
Adding river runoff (from Jiande)
JessicaMeixner-NOAA Oct 25, 2019
100e92d
Merge remote-tracking branch 'GFDL/dev/master' into testnewdevmaster2…
JessicaMeixner-NOAA Nov 7, 2019
07481e4
updating mom_cap to add data override which was deleted in merge
JessicaMeixner-NOAA Nov 8, 2019
9a6f7f6
Merge NOAA-GFDL dev/master from 20191107
JessicaMeixner-NOAA Nov 13, 2019
ba6140c
Merge pull request #1 from NOAA-EMC/dev/emc
DeniseWorthen Nov 16, 2019
419a021
removes data_override and associated calls from mom_cap
DeniseWorthen Nov 16, 2019
64be85f
minor text changes; uncomment runoff heat flux terms; required
DeniseWorthen Nov 17, 2019
7f2b93e
Replace lbm to lbd (lateral boundary diffusion)
gustavo-marques Nov 18, 2019
6bce8ab
Clean the code and fix line length exceeding 120
gustavo-marques Nov 18, 2019
0a89aac
Fix registry of lbd diagnostics
gustavo-marques Nov 19, 2019
b1ce184
Documentation and minor improvements
gustavo-marques Nov 20, 2019
b66eafe
backs out change in standard name for liquid and frozen heat flux
DeniseWorthen Nov 20, 2019
2c6bdf9
Create a separate param for MEKE bottom drag (CDRAG_MEKE)
gustavo-marques Nov 20, 2019
147f7a3
Merge pull request #130 from DeniseWorthen/feature/runoff_optional
gustavo-marques Nov 21, 2019
7135281
Merge pull request #8 from DeniseWorthen/feature/runoff_optional
DeniseWorthen Nov 22, 2019
f3dba16
Add new option to avoid negative thicknesses
ashao Dec 3, 2019
9303e99
Fix typos and bugs
gustavo-marques Dec 4, 2019
e71a573
Fix doxygen references
gustavo-marques Dec 4, 2019
02c986a
Set default value to 0.003
gustavo-marques Dec 4, 2019
97d07bc
Set the default for CDRAG_MEKE to CDRAG
gustavo-marques Dec 5, 2019
cb79e97
add changes from old MOM6 repo in cmeps_integration branch that were …
DeniseWorthen Dec 5, 2019
a2d9636
Merge pull request #131 from gustavo-marques/meke_khtr
alperaltuntas Dec 6, 2019
20d076b
Modify continuous neutral diffusion to account for boundary layer
Dec 6, 2019
89eaede
Delete ocean_model_data_get* from all the caps
gustavo-marques Dec 9, 2019
c50a978
Toggle continuous neutral diffusion in interior only
Dec 9, 2019
8c95cc0
Fix bugs in Leith add new input parameter
gustavo-marques Dec 10, 2019
78bb4c1
Delete quotes from doxygen comment
gustavo-marques Dec 11, 2019
2c7de66
Merge pull request #132 from NOAA-EMC/dev/emc
alperaltuntas Dec 12, 2019
e538144
remove duplicate fld_list_add calls
alperaltuntas Dec 12, 2019
3d17e03
Merge pull request #133 from gustavo-marques/clean_caps
alperaltuntas Dec 12, 2019
2cccc83
Merge pull request #134 from gustavo-marques/fix_leith
alperaltuntas Dec 12, 2019
8a3e3e7
Merge branch 'near_surface_fluxes' into LBD_merge
gustavo-marques Dec 20, 2019
d276f3f
Merge branch 'dev/ncar' into near_surface_fluxes
gustavo-marques Dec 24, 2019
c358114
Merge pull request #135 from gustavo-marques/LBD_merge
alperaltuntas Dec 31, 2019
c7c7bf1
Merge branch 'dev-master-candidate-2019-12-17' into merge-dev-master-…
gustavo-marques Dec 31, 2019
a12abd6
Revert "Merge pull request #133 from gustavo-marques/clean_caps"
gustavo-marques Jan 6, 2020
f7debed
Delete ocean_model_data_get from MCT and NUOPC caps
gustavo-marques Jan 6, 2020
0188f35
Merge branch 'dev-master-candidate-2019-12-17' into merge-dev-master-…
gustavo-marques Jan 6, 2020
1d1914f
Merge pull request #136 from gustavo-marques/merge-dev-master-candida…
alperaltuntas Jan 7, 2020
44d36c4
Merge pull request #138 from gustavo-marques/fix_ocean_model_data_get
alperaltuntas Jan 7, 2020
1ae069b
Merge branch 'dev/ncar' into near_surface_fluxes
gustavo-marques Jan 8, 2020
e2bafc5
fix omp directives in MOM_thickness_diffuse
alperaltuntas Jan 9, 2020
4fe0191
Compute tracer tendency due to lateral diffusion
gustavo-marques Jan 9, 2020
31d2941
Fix bug in boundary_k_range if hbl > htot
Jan 10, 2020
408bd2f
Merge branch 'near_surface_fluxes' of github.com:ashao/MOM6 into near…
Jan 10, 2020
5c8b32f
Fix a bug when checking if hbl > htot
gustavo-marques Jan 10, 2020
dce59f4
Fix a bug in the LBD method 2
gustavo-marques Jan 15, 2020
c8361e7
Add a note saying khtr_avg should be computed once khtr is 3D
gustavo-marques Jan 15, 2020
248a87c
Fix units description and delete placeholder for the pressure reconst…
gustavo-marques Jan 22, 2020
0525a4c
Change flux limiting calculation
gustavo-marques Jan 23, 2020
9db5ba1
Improve documentation and unit tests
gustavo-marques Feb 7, 2020
1ed6b94
Merge pull request #139 from gustavo-marques/update_LBD
alperaltuntas Feb 10, 2020
22f0242
Merge branch 'dev/ncar' of https://github.com/NCAR/MOM6 into dev/ncar
alperaltuntas Feb 10, 2020
63cf741
fix kpp omp directives
alperaltuntas Jan 9, 2020
3540446
fix unitialized logical var in MOM_MEKE
alperaltuntas Feb 10, 2020
a9c896e
set CS%MEKE_equilibrium_restoring, to false by default
alperaltuntas Feb 10, 2020
ab54b96
Merge pull request #140 from alperaltuntas/fix_omp2
gustavo-marques Feb 10, 2020
435a741
Close param file before it gets opened by ocean_model_init again.
alperaltuntas Feb 12, 2020
ba5a442
if not allocated, do not assign R_rho
alperaltuntas Feb 12, 2020
83da090
Merge pull request #141 from alperaltuntas/fix_gnu_bugs
gustavo-marques Feb 12, 2020
46b1f34
correct namespace name for doxygen
alperaltuntas Feb 26, 2020
67e5481
fix omp directive for melt_potential
alperaltuntas Mar 4, 2020
049abb0
fix omp directives in set_viscous_BBL
alperaltuntas Mar 5, 2020
21918b4
comment out OMP directives in KPP_compute_BLD temporarily
alperaltuntas Mar 6, 2020
7533454
fix omp in calculate_diagnostic_fields
alperaltuntas Mar 6, 2020
4478066
uncomment omp do block in advect_tracer
alperaltuntas Mar 6, 2020
276c6b4
call chksum for drag_vel if its allocated
alperaltuntas Mar 6, 2020
f832925
initialize fluid entrainment arrays
alperaltuntas Mar 6, 2020
0eb0615
Merge pull request #142 from NCAR/omp_fixes
gustavo-marques Mar 9, 2020
c429824
Fix a bug in the vmGM field when using GEOMETRIC
gustavo-marques Mar 10, 2020
c012019
Merge pull request #143 from gustavo-marques/fix_vhGM_GEOMETRIC
alperaltuntas Mar 12, 2020
1ecade5
Updates GME by removing dependency on MEKE
gustavo-marques Mar 13, 2020
1f308a0
Extend loop indices and add calls to pass_vector
gustavo-marques Mar 18, 2020
afe0335
Merge pull request #144 from gustavo-marques/merge_GME_outside_MEKE
alperaltuntas Mar 19, 2020
6636e0f
fix OMP directive variable list
alperaltuntas Mar 19, 2020
3d05d85
make T_adx_2d diagnostics thread-safe
alperaltuntas Mar 24, 2020
3768a11
make advect_y thread-safe
alperaltuntas Mar 25, 2020
8025fd4
refactor advect_x and advect_y calls
alperaltuntas Mar 25, 2020
0cddf1f
Merge pull request #146 from NCAR/fix_tracer_advect_omp
gustavo-marques Mar 26, 2020
6ce3dd9
Change CDRAG_MEKE to MEKE_CDRAG
gustavo-marques Mar 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 0 additions & 100 deletions config_src/mct_driver/mom_ocean_model_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,8 @@ module MOM_ocean_model_mct
public ocean_model_restart
public ice_ocn_bnd_type_chksum
public ocean_public_type_chksum
public ocean_model_data_get
public get_ocean_grid

!> This interface extracts a named scalar field or array from the ocean surface or public type
interface ocean_model_data_get
module procedure ocean_model_data1D_get
module procedure ocean_model_data2D_get
end interface


!> This type is used for communication with other components via the FMS coupler.
!! The element names and types can be changed only with great deliberation, hence
!! the persistnce of things like the cutsy element name "avg_kount".
Expand Down Expand Up @@ -1052,98 +1044,6 @@ subroutine Ocean_stock_pe(OS, index, value, time_index)

end subroutine Ocean_stock_pe

!> This subroutine extracts a named 2-D field from the ocean surface or public type
subroutine ocean_model_data2D_get(OS,Ocean, name, array2D,isc,jsc)
use MOM_constants, only : CELSIUS_KELVIN_OFFSET
type(ocean_state_type), pointer :: OS !< A pointer to the structure containing the
!! internal ocean state (intent in).
type(ocean_public_type), intent(in) :: Ocean !< A structure containing various publicly
!! visible ocean surface fields.
character(len=*) , intent(in) :: name !< The name of the field to extract
real, dimension(isc:,jsc:), intent(out):: array2D !< The values of the named field, it must
!! cover only the computational domain
integer , intent(in) :: isc !< The starting i-index of array2D
integer , intent(in) :: jsc !< The starting j-index of array2D

integer :: g_isc, g_iec, g_jsc, g_jec,g_isd, g_ied, g_jsd, g_jed, i, j

if (.not.associated(OS)) return
if (.not.OS%is_ocean_pe) return

! The problem is %areaT is on MOM domain but Ice_Ocean_Boundary%... is on mpp domain.
! We want to return the MOM data on the mpp (compute) domain
! Get MOM domain extents
call mpp_get_compute_domain(OS%grid%Domain%mpp_domain, g_isc, g_iec, g_jsc, g_jec)
call mpp_get_data_domain (OS%grid%Domain%mpp_domain, g_isd, g_ied, g_jsd, g_jed)

g_isc = g_isc-g_isd+1 ; g_iec = g_iec-g_isd+1 ; g_jsc = g_jsc-g_jsd+1 ; g_jec = g_jec-g_jsd+1


select case(name)
case('area')
array2D(isc:,jsc:) = OS%US%L_to_m**2*OS%grid%areaT(g_isc:g_iec,g_jsc:g_jec)
case('mask')
array2D(isc:,jsc:) = OS%grid%mask2dT(g_isc:g_iec,g_jsc:g_jec)
!OR same result
! do j=g_jsc,g_jec ; do i=g_isc,g_iec
! array2D(isc+i-g_isc,jsc+j-g_jsc) = OS%grid%mask2dT(i,j)
! enddo ; enddo
case('t_surf')
array2D(isc:,jsc:) = Ocean%t_surf(isc:,jsc:)-CELSIUS_KELVIN_OFFSET
case('t_pme')
array2D(isc:,jsc:) = Ocean%t_surf(isc:,jsc:)-CELSIUS_KELVIN_OFFSET
case('t_runoff')
array2D(isc:,jsc:) = Ocean%t_surf(isc:,jsc:)-CELSIUS_KELVIN_OFFSET
case('t_calving')
array2D(isc:,jsc:) = Ocean%t_surf(isc:,jsc:)-CELSIUS_KELVIN_OFFSET
case('btfHeat')
array2D(isc:,jsc:) = 0
case('tlat')
array2D(isc:,jsc:) = OS%grid%geoLatT(g_isc:g_iec,g_jsc:g_jec)
case('tlon')
array2D(isc:,jsc:) = OS%grid%geoLonT(g_isc:g_iec,g_jsc:g_jec)
case('ulat')
array2D(isc:,jsc:) = OS%grid%geoLatCu(g_isc:g_iec,g_jsc:g_jec)
case('ulon')
array2D(isc:,jsc:) = OS%grid%geoLonCu(g_isc:g_iec,g_jsc:g_jec)
case('vlat')
array2D(isc:,jsc:) = OS%grid%geoLatCv(g_isc:g_iec,g_jsc:g_jec)
case('vlon')
array2D(isc:,jsc:) = OS%grid%geoLonCv(g_isc:g_iec,g_jsc:g_jec)
case('geoLatBu')
array2D(isc:,jsc:) = OS%grid%geoLatBu(g_isc:g_iec,g_jsc:g_jec)
case('geoLonBu')
array2D(isc:,jsc:) = OS%grid%geoLonBu(g_isc:g_iec,g_jsc:g_jec)
case('cos_rot')
array2D(isc:,jsc:) = OS%grid%cos_rot(g_isc:g_iec,g_jsc:g_jec) ! =1
case('sin_rot')
array2D(isc:,jsc:) = OS%grid%sin_rot(g_isc:g_iec,g_jsc:g_jec) ! =0
case default
call MOM_error(FATAL,'get_ocean_grid_data2D: unknown argument name='//name)
end select
end subroutine ocean_model_data2D_get

!> This subroutine extracts a named scalar field from the ocean surface or public type
subroutine ocean_model_data1D_get(OS, Ocean, name, value)
type(ocean_state_type), pointer :: OS !< A pointer to the structure containing the
!! internal ocean state (intent in).
type(ocean_public_type), intent(in) :: Ocean !< A structure containing various publicly
!! visible ocean surface fields.
character(len=*) , intent(in) :: name !< The name of the field to extract
real , intent(out):: value !< The value of the named field

if (.not.associated(OS)) return
if (.not.OS%is_ocean_pe) return

select case(name)
case('c_p')
value = OS%C_p
case default
call MOM_error(FATAL,'get_ocean_grid_data1D: unknown argument name='//name)
end select

end subroutine ocean_model_data1D_get

!> Write out FMS-format checsums on fields from the ocean surface state
subroutine ocean_public_type_chksum(id, timestep, ocn)

Expand Down
5 changes: 4 additions & 1 deletion config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module ocn_comp_mct
use MOM_time_manager, only: time_type, set_date, set_time, set_calendar_type, NOLEAP
use MOM_time_manager, only: operator(+), operator(-), operator(*), operator(/)
use MOM_time_manager, only: operator(==), operator(/=), operator(>), get_time
use MOM_file_parser, only: get_param, log_version, param_file_type
use MOM_file_parser, only: get_param, log_version, param_file_type, close_param_file
use MOM_get_input, only: Get_MOM_Input, directories
use MOM_EOS, only: gsw_sp_from_sr, gsw_pt_from_ct
use MOM_constants, only: CELSIUS_KELVIN_OFFSET
Expand Down Expand Up @@ -281,6 +281,9 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
glb%c1 = 0.0; glb%c2 = 0.0; glb%c3 = 0.0; glb%c4 = 0.0
endif

! Close param file before it gets opened by ocean_model_init again.
call close_param_file(param_file)

! Initialize the MOM6 model
runtype = get_runtype()
if (runtype == "initial") then
Expand Down
71 changes: 40 additions & 31 deletions config_src/nuopc_driver/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ module MOM_cap_mod
integer :: export_slice = 1
character(len=256) :: tmpstr
logical :: write_diagnostics = .false.
logical :: overwrite_timeslice = .false.
character(len=32) :: runtype !< run type
integer :: logunit !< stdout logging unit number
logical :: profile_memory = .true.
Expand Down Expand Up @@ -278,6 +279,21 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
file=__FILE__)) &
return

overwrite_timeslice = .false.
call NUOPC_CompAttributeGet(gcomp, name="OverwriteSlice", value=value, &
isPresent=isPresent, isSet=isSet, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return
if (isPresent .and. isSet) overwrite_timeslice=(trim(value)=="true")
write(logmsg,*) overwrite_timeslice
call ESMF_LogWrite('MOM_cap:OverwriteSlice = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return

profile_memory = .false.
call NUOPC_CompAttributeGet(gcomp, name="ProfileMemory", value=value, &
isPresent=isPresent, isSet=isSet, rc=rc)
Expand Down Expand Up @@ -708,12 +724,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
Ice_ocean_boundary% seaice_melt (isc:iec,jsc:jec), &
Ice_ocean_boundary% mi (isc:iec,jsc:jec), &
Ice_ocean_boundary% p (isc:iec,jsc:jec), &
Ice_ocean_boundary% runoff (isc:iec,jsc:jec), &
Ice_ocean_boundary% calving (isc:iec,jsc:jec), &
Ice_ocean_boundary% runoff_hflx (isc:iec,jsc:jec), &
Ice_ocean_boundary% calving_hflx (isc:iec,jsc:jec), &
Ice_ocean_boundary% rofl_flux (isc:iec,jsc:jec), &
Ice_ocean_boundary% rofi_flux (isc:iec,jsc:jec))
Ice_ocean_boundary% lrunoff_hflx (isc:iec,jsc:jec), &
Ice_ocean_boundary% frunoff_hflx (isc:iec,jsc:jec), &
Ice_ocean_boundary% lrunoff (isc:iec,jsc:jec), &
Ice_ocean_boundary% frunoff (isc:iec,jsc:jec))

Ice_ocean_boundary%u_flux = 0.0
Ice_ocean_boundary%v_flux = 0.0
Expand All @@ -731,12 +745,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
Ice_ocean_boundary%seaice_melt_heat= 0.0
Ice_ocean_boundary%mi = 0.0
Ice_ocean_boundary%p = 0.0
Ice_ocean_boundary%runoff = 0.0
Ice_ocean_boundary%calving = 0.0
Ice_ocean_boundary%runoff_hflx = 0.0
Ice_ocean_boundary%calving_hflx = 0.0
Ice_ocean_boundary%rofl_flux = 0.0
Ice_ocean_boundary%rofi_flux = 0.0
Ice_ocean_boundary%lrunoff_hflx = 0.0
Ice_ocean_boundary%frunoff_hflx = 0.0
Ice_ocean_boundary%lrunoff = 0.0
Ice_ocean_boundary%frunoff = 0.0

ocean_internalstate%ptr%ocean_state_type_ptr => ocean_state
call ESMF_GridCompSetInternalState(gcomp, ocean_internalstate, rc)
Expand All @@ -745,11 +757,12 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
file=__FILE__)) &
return ! bail out

if (len_trim(scalar_field_name) > 0) then
call fld_list_add(fldsToOcn_num, fldsToOcn, trim(scalar_field_name), "will_provide")
call fld_list_add(fldsFrOcn_num, fldsFrOcn, trim(scalar_field_name), "will_provide")
end if

if (cesm_coupled) then
if (len_trim(scalar_field_name) > 0) then
call fld_list_add(fldsToOcn_num, fldsToOcn, trim(scalar_field_name), "will_provide")
call fld_list_add(fldsFrOcn_num, fldsFrOcn, trim(scalar_field_name), "will_provide")
endif
!call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_lamult" , "will provide")
!call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_ustokes" , "will provide")
!call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_vstokes" , "will provide")
Expand Down Expand Up @@ -780,11 +793,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_rofi" , "will provide") !-> ice runoff
call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_fresh_water_to_ocean_rate", "will provide")
call fld_list_add(fldsToOcn_num, fldsToOcn, "net_heat_flx_to_ocn" , "will provide")

!call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_rate" , "will provide")
!call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_rate" , "will provide")
!call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_heat_flx" , "will provide")
!call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_heat_flx" , "will provide")
!These are not currently used and changing requires a nuopc dictionary change
!call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_heat_flx" , "will provide")
!call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_heat_flx" , "will provide")

!--------- export fields -------------
call fld_list_add(fldsFrOcn_num, fldsFrOcn, "ocean_mask" , "will provide")
Expand Down Expand Up @@ -1494,13 +1505,11 @@ subroutine DataInitialize(gcomp, rc)
ocean_state => ocean_internalstate%ptr%ocean_state_type_ptr
call get_ocean_grid(ocean_state, ocean_grid)

if (cesm_coupled) then
call mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out
endif
call mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out

call ESMF_StateGet(exportState, itemCount=fieldCount, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
Expand Down Expand Up @@ -1543,7 +1552,7 @@ subroutine DataInitialize(gcomp, rc)

if(write_diagnostics) then
call NUOPC_Write(exportState, fileNamePrefix='field_init_ocn_export_', &
timeslice=import_slice, relaxedFlag=.true., rc=rc)
overwrite=overwrite_timeslice,timeslice=import_slice, relaxedFlag=.true., rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down Expand Up @@ -1697,7 +1706,7 @@ subroutine ModelAdvance(gcomp, rc)

if (write_diagnostics) then
call NUOPC_Write(importState, fileNamePrefix='field_ocn_import_', &
timeslice=import_slice, relaxedFlag=.true., rc=rc)
overwrite=overwrite_timeslice,timeslice=import_slice, relaxedFlag=.true., rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down Expand Up @@ -1853,7 +1862,7 @@ subroutine ModelAdvance(gcomp, rc)

if (write_diagnostics) then
call NUOPC_Write(exportState, fileNamePrefix='field_ocn_export_', &
timeslice=export_slice, relaxedFlag=.true., rc=rc)
overwrite=overwrite_timeslice,timeslice=export_slice, relaxedFlag=.true., rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down
48 changes: 13 additions & 35 deletions config_src/nuopc_driver/mom_cap_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -214,64 +214,42 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
return ! bail out

!----
! runoff and heat content of runoff
! mass and heat content of liquid and frozen runoff
!----
! Note - preset values to 0, if field does not exist in importState, then will simply return
! and preset value will be used

! liquid runoff
ice_ocean_boundary%rofl_flux (:,:) = 0._ESMF_KIND_R8
ice_ocean_boundary%lrunoff (:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'Foxx_rofl', &
isc, iec, jsc, jec, ice_ocean_boundary%rofl_flux,rc=rc)
isc, iec, jsc, jec, ice_ocean_boundary%lrunoff,rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out

! ice runoff
ice_ocean_boundary%rofi_flux (:,:) = 0._ESMF_KIND_R8
ice_ocean_boundary%frunoff (:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'Foxx_rofi', &
isc, iec, jsc, jec, ice_ocean_boundary%rofi_flux,rc=rc)
isc, iec, jsc, jec, ice_ocean_boundary%frunoff,rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out

! total runoff
ice_ocean_boundary%runoff (:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'mean_runoff_rate', &
isc, iec, jsc, jec, ice_ocean_boundary%runoff, rc=rc)
! heat content of lrunoff
ice_ocean_boundary%lrunoff_hflx(:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'mean_runoff_heat_flx', &
isc, iec, jsc, jec, ice_ocean_boundary%lrunoff_hflx, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out

! heat content of runoff
ice_ocean_boundary%runoff_hflx(:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'mean_runoff_heat_flux', &
isc, iec, jsc, jec, ice_ocean_boundary%runoff_hflx, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out

!----
! calving rate and heat flux
!----
! Note - preset values to 0, if field does not exist in importState, then will simply return
! and preset value will be used

ice_ocean_boundary%calving(:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'mean_calving_rate', &
isc, iec, jsc, jec, ice_ocean_boundary%calving, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out

ice_ocean_boundary%calving_hflx(:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'mean_calving_heat_flux', &
isc, iec, jsc, jec, ice_ocean_boundary%calving_hflx, rc=rc)
! heat content of frunoff
ice_ocean_boundary%frunoff_hflx(:,:) = 0._ESMF_KIND_R8
call state_getimport(importState, 'mean_calving_heat_flx', &
isc, iec, jsc, jec, ice_ocean_boundary%frunoff_hflx, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down
Loading