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

Update to GFDL 20200401 dev/master #18

Merged
merged 135 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 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
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
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
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
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
e73db38
Merge branch 'dev-master-candidate-ncar-2020-03-27' of https://github…
adcroft Mar 30, 2020
010492e
Merge branch 'gustavo-marques-dev-master-candidate-ncar-2020-03-27' i…
adcroft Apr 1, 2020
6aec544
merge GFDL dev/master 20200401 commit (hash # 010492e2)
jiandewang Apr 3, 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
5 changes: 0 additions & 5 deletions config_src/nuopc_driver/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if

if (cesm_coupled) then
!TODO: check if still needed
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
101 changes: 0 additions & 101 deletions config_src/nuopc_driver/mom_ocean_model_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,9 @@ module MOM_ocean_model_nuopc
public ocean_model_restart
public ice_ocn_bnd_type_chksum
public ocean_public_type_chksum
public ocean_model_data_get
public get_ocean_grid
public get_eps_omesh

!> 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 @@ -1047,99 +1039,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
6 changes: 3 additions & 3 deletions config_src/nuopc_driver/mom_surface_forcing_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,12 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
! liquid runoff flux
if (associated(IOB%lrunoff)) then
if(CS%liquid_runoff_from_data)call data_override('OCN', 'runoff', IOB%lrunoff, Time)
fluxes%lrunoff(i,j) = IOB%lrunoff(i-i0,j-j0) * G%mask2dT(i,j)
fluxes%lrunoff(i,j) = kg_m2_s_conversion * IOB%lrunoff(i-i0,j-j0) * G%mask2dT(i,j)
endif

! ice runoff flux
if (associated(IOB%frunoff)) then
fluxes%frunoff(i,j) = IOB%frunoff(i-i0,j-j0) * G%mask2dT(i,j)
fluxes%frunoff(i,j) = kg_m2_s_conversion * IOB%frunoff(i-i0,j-j0) * G%mask2dT(i,j)
endif

if (associated(IOB%ustar_berg)) &
Expand All @@ -465,7 +465,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
fluxes%heat_content_lrunoff(i,j) = IOB%lrunoff_hflx(i-i0,j-j0) * G%mask2dT(i,j)

if (associated(IOB%frunoff_hflx)) &
fluxes%heat_content_frunoff(i,j) = IOB%frunoff_hflx(i-i0,j-j0) * G%mask2dT(i,j)
fluxes%heat_content_frunoff(i,j) = kg_m2_s_conversion * IOB%frunoff_hflx(i-i0,j-j0) * G%mask2dT(i,j)

if (associated(IOB%lw_flux)) &
fluxes%LW(i,j) = IOB%lw_flux(i-i0,j-j0) * G%mask2dT(i,j)
Expand Down
9 changes: 6 additions & 3 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module MOM
use MOM_hor_index, only : hor_index_type, hor_index_init
use MOM_interface_heights, only : find_eta
use MOM_lateral_mixing_coeffs, only : calc_slope_functions, VarMix_init
use MOM_lateral_mixing_coeffs, only : calc_resoln_function, VarMix_CS
use MOM_lateral_mixing_coeffs, only : calc_resoln_function, calc_depth_function, VarMix_CS
use MOM_MEKE, only : MEKE_init, MEKE_alloc_register_restart, step_forward_MEKE, MEKE_CS
use MOM_MEKE_types, only : MEKE_type
use MOM_mixed_layer_restrat, only : mixedlayer_restrat, mixedlayer_restrat_init, mixedlayer_restrat_CS
Expand Down Expand Up @@ -566,6 +566,7 @@ subroutine step_MOM(forces, fluxes, sfc_state, Time_start, time_int_in, CS, &
if (associated(CS%VarMix)) then
call enable_averages(cycle_time, Time_start + real_to_time(US%T_to_s*cycle_time), CS%diag)
call calc_resoln_function(h, CS%tv, G, GV, US, CS%VarMix)
call calc_depth_function(G, CS%VarMix)
call disable_averaging(CS%diag)
endif
endif
Expand Down Expand Up @@ -1406,6 +1407,7 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
if (associated(CS%VarMix)) then
call pass_var(CS%h, G%Domain)
call calc_resoln_function(CS%h, CS%tv, G, GV, US, CS%VarMix)
call calc_depth_function(G, CS%VarMix)
call calc_slope_functions(CS%h, CS%tv, dt_offline, G, GV, US, CS%VarMix)
endif
call tracer_hordiff(CS%h, dt_offline, CS%MEKE, CS%VarMix, G, GV, US, &
Expand All @@ -1431,6 +1433,7 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
if (associated(CS%VarMix)) then
call pass_var(CS%h, G%Domain)
call calc_resoln_function(CS%h, CS%tv, G, GV, US, CS%VarMix)
call calc_depth_function(G, CS%VarMix)
call calc_slope_functions(CS%h, CS%tv, dt_offline, G, GV, US, CS%VarMix)
endif
call tracer_hordiff(CS%h, dt_offline, CS%MEKE, CS%VarMix, G, GV, US, &
Expand Down Expand Up @@ -2373,7 +2376,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
endif

call tracer_advect_init(Time, G, US, param_file, diag, CS%tracer_adv_CSp)
call tracer_hor_diff_init(Time, G, US, param_file, diag, CS%tv%eqn_of_state, &
call tracer_hor_diff_init(Time, G, US, param_file, diag, CS%tv%eqn_of_state, CS%diabatic_CSp, &
CS%tracer_diff_CSp)

call lock_tracer_registry(CS%tracer_Reg)
Expand Down Expand Up @@ -2894,7 +2897,7 @@ subroutine extract_surface_state(CS, sfc_state)


if (allocated(sfc_state%melt_potential)) then
!$OMP parallel do default(shared)
!$OMP parallel do default(shared) private(depth_ml, dh, T_freeze, depth, delT)
do j=js,je
do i=is,ie
depth(i) = 0.0
Expand Down
5 changes: 3 additions & 2 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
call cpu_clock_begin(id_clock_horvisc)
call horizontal_viscosity(u_av, v_av, h_av, CS%diffu, CS%diffv, &
MEKE, Varmix, G, GV, US, CS%hor_visc_CSp, &
OBC=CS%OBC, BT=CS%barotropic_CSp)
OBC=CS%OBC, BT=CS%barotropic_CSp, TD=thickness_diffuse_CSp)
call cpu_clock_end(id_clock_horvisc)
if (showCallTree) call callTree_wayPoint("done with horizontal_viscosity (step_MOM_dyn_split_RK2)")

Expand Down Expand Up @@ -1149,7 +1149,8 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, US, param
.not. query_initialized(CS%diffv,"diffv",restart_CS)) then
call horizontal_viscosity(u, v, h, CS%diffu, CS%diffv, MEKE, VarMix, &
G, GV, US, CS%hor_visc_CSp, &
OBC=CS%OBC, BT=CS%barotropic_CSp)
OBC=CS%OBC, BT=CS%barotropic_CSp, &
TD=thickness_diffuse_CSp)
else
if ( (US%s_to_T_restart * US%m_to_L_restart /= 0.0) .and. &
(US%m_to_L * US%s_to_T_restart**2 /= US%m_to_L_restart * US%s_to_T**2) ) then
Expand Down
12 changes: 8 additions & 4 deletions src/core/MOM_unit_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ module MOM_unit_tests

use MOM_error_handler, only : MOM_error, FATAL, is_root_pe

use MOM_string_functions, only : string_functions_unit_tests
use MOM_remapping, only : remapping_unit_tests
use MOM_neutral_diffusion, only : neutral_diffusion_unit_tests
use MOM_diag_vkernels, only : diag_vkernels_unit_tests
use MOM_string_functions, only : string_functions_unit_tests
use MOM_remapping, only : remapping_unit_tests
use MOM_neutral_diffusion, only : neutral_diffusion_unit_tests
use MOM_diag_vkernels, only : diag_vkernels_unit_tests
use MOM_lateral_boundary_diffusion, only : near_boundary_unit_tests

implicit none ; private

Expand All @@ -35,6 +36,9 @@ subroutine unit_tests(verbosity)
"MOM_unit_tests: neutralDiffusionUnitTests FAILED")
if (diag_vkernels_unit_tests(verbose)) call MOM_error(FATAL, &
"MOM_unit_tests: diag_vkernels_unit_tests FAILED")
if (near_boundary_unit_tests(verbose)) call MOM_error(FATAL, &
"MOM_unit_tests: near_boundary_unit_tests FAILED")

endif

end subroutine unit_tests
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics/MOM_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, &
if (CS%id_rhopot2 > 0) call post_data(CS%id_rhopot2, Rcv, CS%diag)
endif
if (CS%id_rhoinsitu > 0) then
!$OMP parallel do default(none) shared(tv,Rcv,is,ie,js,je,nz,pressure_1d,h,GV)
!$OMP parallel do default(none) shared(tv,Rcv,is,ie,js,je,nz,h,GV) private(pressure_1d)
do j=js,je
pressure_1d(:) = 0. ! Start at p=0 Pa at surface
do k=1,nz
Expand Down
Loading