Skip to content

Commit 44313d9

Browse files
authored
Merge pull request #85 from jiandewang/feature/update-to-main-20220217
update to main branch 20220217 commit
2 parents 32c0e1e + 966707f commit 44313d9

File tree

174 files changed

+9281
-8735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+9281
-8735
lines changed

.testing/Makefile

+10-4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ endif
146146
# These are set to true by our Travis configuration if testing a pull request
147147
DO_REGRESSION_TESTS ?=
148148
REPORT_COVERAGE ?=
149+
CODECOV_UPLOADER_URL ?= https://uploader.codecov.io/latest/linux/codecov
149150

150151
ifeq ($(DO_REGRESSION_TESTS), true)
151152
BUILDS += target
@@ -165,6 +166,7 @@ else
165166
endif
166167

167168

169+
168170
# List of source files to link this Makefile's dependencies to model Makefiles
169171
# Assumes a depth of two, and the following extensions: F90 inc c h
170172
# (1): Root directory
@@ -542,6 +544,7 @@ $(foreach c,$(CONFIGS),$(eval $(call CONFIG_DIM_RULE,$(c))))
542544
# $(4): MOM_override configuration
543545
# $(5): Environment variables
544546
# $(6): Number of MPI ranks
547+
545548
define STAT_RULE
546549
work/%/$(1)/ocean.stats work/%/$(1)/chksum_diag: build/$(2)/MOM6 $(VENV_PATH)
547550
@echo "Running test $$*.$(1)..."
@@ -570,10 +573,13 @@ work/%/$(1)/ocean.stats work/%/$(1)/chksum_diag: build/$(2)/MOM6 $(VENV_PATH)
570573
@echo -e "$(DONE): $$*.$(1); no runtime errors."
571574
if [ $(3) ]; then \
572575
mkdir -p results/$$* ; \
573-
cd build/symmetric \
574-
&& bash <(curl -s https://codecov.io/bash) -Z -n $$@ \
575-
> codecov.$$*.$(1).out \
576-
2> codecov.$$*.$(1).err \
576+
cd build/symmetric ; \
577+
gcov *.gcda > gcov.$$*.$(1).out ; \
578+
curl -s $(CODECOV_UPLOADER_URL) -o codecov ; \
579+
chmod +x codecov ; \
580+
./codecov -Z -f "*.gcov" -n $$@ \
581+
> codecov.$$*.$(1).out \
582+
2> codecov.$$*.$(1).err \
577583
&& echo -e "${MAGENTA}Report uploaded to codecov.${RESET}"; \
578584
fi
579585
endef

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
[![Build Status](https://travis-ci.org/NOAA-GFDL/MOM6.svg?branch=dev/master)](https://travis-ci.org/NOAA-GFDL/MOM6)
21
[![Read The Docs Status](https://readthedocs.org/projects/mom6/badge/?badge=latest)](http://mom6.readthedocs.io/)
3-
[![codecov](https://codecov.io/gh/NOAA-GFDL/MOM6/branch/dev%2Fmaster/graph/badge.svg)](https://codecov.io/gh/NOAA-GFDL/MOM6)
2+
[![codecov](https://codecov.io/gh/NOAA-GFDL/MOM6/branch/dev/gfdl/graph/badge.svg?token=uF8SVydCdp)](https://codecov.io/gh/NOAA-GFDL/MOM6)
43

54
# MOM6
65

config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90

+64-44
Large diffs are not rendered by default.

config_src/drivers/FMS_cap/ocean_model_MOM.F90

+26-25
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module ocean_model_mod
8686

8787
!> This type is used for communication with other components via the FMS coupler.
8888
!! The element names and types can be changed only with great deliberation, hence
89-
!! the persistnce of things like the cutsy element name "avg_kount".
89+
!! the persistence of things like the cutesy element name "avg_kount".
9090
type, public :: ocean_public_type
9191
type(domain2d) :: Domain !< The domain for the surface fields.
9292
logical :: is_ocean_pe !< .true. on processors that run the ocean model.
@@ -110,8 +110,8 @@ module ocean_model_mod
110110
!! a global max across ocean and non-ocean processors can be
111111
!! used to determine its value.
112112
real, pointer, dimension(:,:) :: &
113-
t_surf => NULL(), & !< SST on t-cell (degrees Kelvin)
114-
s_surf => NULL(), & !< SSS on t-cell (psu)
113+
t_surf => NULL(), & !< SST on t-cell [degrees Kelvin]
114+
s_surf => NULL(), & !< SSS on t-cell [ppt]
115115
u_surf => NULL(), & !< i-velocity at the locations indicated by stagger [m s-1].
116116
v_surf => NULL(), & !< j-velocity at the locations indicated by stagger [m s-1].
117117
sea_lev => NULL(), & !< Sea level in m after correction for surface pressure,
@@ -154,8 +154,8 @@ module ocean_model_mod
154154

155155
logical :: icebergs_alter_ocean !< If true, the icebergs can change ocean the
156156
!! ocean dynamics and forcing fluxes.
157-
real :: press_to_z !< A conversion factor between pressure and ocean
158-
!! depth in m, usually 1/(rho_0*g) [m Pa-1].
157+
real :: press_to_z !< A conversion factor between pressure and ocean depth,
158+
!! usually 1/(rho_0*g) [Z T2 R-1 L-2 ~> m Pa-1].
159159
real :: C_p !< The heat capacity of seawater [J degC-1 kg-1].
160160
logical :: offline_tracer_mode = .false. !< If false, use the model in prognostic mode
161161
!! with the barotropic and baroclinic dynamics, thermodynamics,
@@ -221,7 +221,7 @@ module ocean_model_mod
221221
!! for restarts and reading restart files if appropriate.
222222
!!
223223
!! This subroutine initializes both the ocean state and the ocean surface type.
224-
!! Because of the way that indicies and domains are handled, Ocean_sfc must have
224+
!! Because of the way that indices and domains are handled, Ocean_sfc must have
225225
!! been used in a previous call to initialize_ocean_type.
226226
subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, wind_stagger, gas_fields_ocn)
227227
type(ocean_public_type), target, &
@@ -242,16 +242,16 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, wind_stagger, gas
242242
!! tracer fluxes, and can be used to spawn related
243243
!! internal variables in the ice model.
244244
! Local variables
245-
real :: Rho0 ! The Boussinesq ocean density [kg m-3].
246-
real :: G_Earth ! The gravitational acceleration [m s-2].
247-
real :: HFrz !< If HFrz > 0 (m), melt potential will be computed.
245+
real :: Rho0 ! The Boussinesq ocean density [R ~> kg m-3]
246+
real :: G_Earth ! The gravitational acceleration [L2 Z-1 T-2 ~> m s-2]
247+
real :: HFrz !< If HFrz > 0 [Z ~> m], melt potential will be computed.
248248
!! The actual depth over which melt potential is computed will
249249
!! min(HFrz, OBLD), where OBLD is the boundary layer depth.
250250
!! If HFrz <= 0 (default), melt potential will not be computed.
251-
logical :: use_melt_pot!< If true, allocate melt_potential array
251+
logical :: use_melt_pot !< If true, allocate melt_potential array
252252

253-
! This include declares and sets the variable "version".
254-
#include "version_variable.h"
253+
! This include declares and sets the variable "version".
254+
# include "version_variable.h"
255255
character(len=40) :: mdl = "ocean_model_init" ! This module's name.
256256
character(len=48) :: stagger ! A string indicating the staggering locations for the
257257
! surface velocities returned to the coupler.
@@ -331,28 +331,29 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, wind_stagger, gas
331331
"calculate accelerations and the mass for conservation "//&
332332
"properties, or with BOUSSINSEQ false to convert some "//&
333333
"parameters from vertical units of m to kg m-2.", &
334-
units="kg m-3", default=1035.0)
334+
units="kg m-3", default=1035.0, scale=OS%US%kg_m3_to_R)
335335
call get_param(param_file, mdl, "G_EARTH", G_Earth, &
336336
"The gravitational acceleration of the Earth.", &
337-
units="m s-2", default = 9.80)
337+
units="m s-2", default=9.80, scale=OS%US%m_s_to_L_T**2*OS%US%Z_to_m)
338338

339339
call get_param(param_file, mdl, "ICE_SHELF", OS%use_ice_shelf, &
340340
"If true, enables the ice shelf model.", default=.false.)
341341

342342
call get_param(param_file, mdl, "ICEBERGS_APPLY_RIGID_BOUNDARY", OS%icebergs_alter_ocean, &
343343
"If true, allows icebergs to change boundary condition felt by ocean", default=.false.)
344344

345-
OS%press_to_z = 1.0/(Rho0*G_Earth)
345+
OS%press_to_z = 1.0 / (Rho0*G_Earth)
346346

347347
! Consider using a run-time flag to determine whether to do the diagnostic
348348
! vertical integrals, since the related 3-d sums are not negligible in cost.
349349
call get_param(param_file, mdl, "HFREEZE", HFrz, &
350350
"If HFREEZE > 0, melt potential will be computed. The actual depth "//&
351351
"over which melt potential is computed will be min(HFREEZE, OBLD), "//&
352352
"where OBLD is the boundary layer depth. If HFREEZE <= 0 (default), "//&
353-
"melt potential will not be computed.", units="m", default=-1.0, do_not_log=.true.)
353+
"melt potential will not be computed.", &
354+
units="m", default=-1.0, scale=OS%US%m_to_Z, do_not_log=.true.)
354355

355-
if (HFrz .gt. 0.0) then
356+
if (HFrz > 0.0) then
356357
use_melt_pot=.true.
357358
else
358359
use_melt_pot=.false.
@@ -655,7 +656,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, time_start_upda
655656

656657
! Translate state into Ocean.
657658
! call convert_state_to_ocean_type(OS%sfc_state, Ocean_sfc, OS%grid, OS%US, &
658-
! Ice_ocean_boundary%p, OS%press_to_z)
659+
! OS%fluxes%p_surf_full, OS%press_to_z)
659660
call convert_state_to_ocean_type(OS%sfc_state, Ocean_sfc, OS%grid, OS%US)
660661
Time1 = OS%Time ; if (do_dyn) Time1 = OS%Time_dyn
661662
call coupler_type_send_data(Ocean_sfc%fields, Time1)
@@ -766,7 +767,7 @@ subroutine initialize_ocean_public_type(input_domain, Ocean_sfc, diag, gas_field
766767
!! tracer fluxes.
767768

768769
integer :: xsz, ysz, layout(2)
769-
! ice-ocean-boundary fields are always allocated using absolute indicies
770+
! ice-ocean-boundary fields are always allocated using absolute indices
770771
! and have no halos.
771772
integer :: isc, iec, jsc, jec
772773

@@ -806,7 +807,7 @@ end subroutine initialize_ocean_public_type
806807
!! surface state variable. This may eventually be folded into the MOM
807808
!! code that calculates the surface state in the first place.
808809
!! Note the offset in the arrays because the ocean_data_type has no
809-
!! halo points in its arrays and always uses absolute indicies.
810+
!! halo points in its arrays and always uses absolute indices.
810811
subroutine convert_state_to_ocean_type(sfc_state, Ocean_sfc, G, US, patm, press_to_z)
811812
type(surface), intent(inout) :: sfc_state !< A structure containing fields that
812813
!! describe the surface state of the ocean.
@@ -816,9 +817,9 @@ subroutine convert_state_to_ocean_type(sfc_state, Ocean_sfc, G, US, patm, press_
816817
!! have their data set here.
817818
type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
818819
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
819-
real, optional, intent(in) :: patm(:,:) !< The pressure at the ocean surface [Pa].
820-
real, optional, intent(in) :: press_to_z !< A conversion factor between pressure and
821-
!! ocean depth in m, usually 1/(rho_0*g) [m Pa-1].
820+
real, optional, intent(in) :: patm(:,:) !< The pressure at the ocean surface [R L2 T-2 ~> Pa]
821+
real, optional, intent(in) :: press_to_z !< A conversion factor between pressure and ocean
822+
!! depth, usually 1/(rho_0*g) [Z T2 R-1 L-2 ~> m Pa-1]
822823
! Local variables
823824
real :: IgR0
824825
character(len=48) :: val_str
@@ -860,7 +861,7 @@ subroutine convert_state_to_ocean_type(sfc_state, Ocean_sfc, G, US, patm, press_
860861

861862
if (present(patm)) then
862863
do j=jsc_bnd,jec_bnd ; do i=isc_bnd,iec_bnd
863-
Ocean_sfc%sea_lev(i,j) = US%Z_to_m * sfc_state%sea_lev(i+i0,j+j0) + patm(i,j) * press_to_z
864+
Ocean_sfc%sea_lev(i,j) = US%Z_to_m * (sfc_state%sea_lev(i+i0,j+j0) + patm(i,j) * press_to_z)
864865
Ocean_sfc%area(i,j) = US%L_to_m**2 * G%areaT(i+i0,j+j0)
865866
enddo ; enddo
866867
else
@@ -946,7 +947,7 @@ end subroutine ocean_model_init_sfc
946947

947948
!> ocean_model_flux_init is used to initialize properties of the air-sea fluxes
948949
!! as determined by various run-time parameters. It can be called from
949-
!! non-ocean PEs, or PEs that have not yet been initialzed, and it can safely
950+
!! non-ocean PEs, or PEs that have not yet been initialized, and it can safely
950951
!! be called multiple times.
951952
subroutine ocean_model_flux_init(OS, verbosity)
952953
type(ocean_state_type), optional, pointer :: OS !< An optional pointer to the ocean state,

config_src/drivers/mct_cap/ocn_comp_mct.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ subroutine ocn_domain_mct( lsize, gsMap_ocn, dom_ocn)
722722
call mct_gGrid_importRattr(dom_ocn,"lat",data,lsize)
723723

724724
k = 0
725-
L2_to_rad2 = grid%US%L_to_m**2 / grid%Rad_Earth**2
725+
L2_to_rad2 = 1.0 / grid%Rad_Earth_L**2
726726
do j = grid%jsc, grid%jec
727727
do i = grid%isc, grid%iec
728728
k = k + 1 ! Increment position within gindex

config_src/drivers/nuopc_cap/mom_cap.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
11121112
k = k + 1 ! Increment position within gindex
11131113
if (mask(k) /= 0) then
11141114
mesh_areas(k) = dataPtr_mesh_areas(k)
1115-
model_areas(k) = ocean_grid%US%L_to_m**2 * ocean_grid%AreaT(i,j) / ocean_grid%Rad_Earth**2
1115+
model_areas(k) = ocean_grid%AreaT(i,j) / ocean_grid%Rad_Earth_L**2
11161116
mod2med_areacor(k) = model_areas(k) / mesh_areas(k)
11171117
med2mod_areacor(k) = mesh_areas(k) / model_areas(k)
11181118
end if

config_src/drivers/solo_driver/MESO_surface_forcing.F90

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module MESO_surface_forcing
3131
real :: G_Earth !< The gravitational acceleration [L2 Z-1 T-2 ~> m s-2].
3232
real :: Flux_const !< The restoring rate at the surface [Z T-1 ~> m s-1].
3333
real :: gust_const !< A constant unresolved background gustiness
34-
!! that contributes to ustar [Pa].
34+
!! that contributes to ustar [R L Z T-1 ~> Pa]
3535
real, dimension(:,:), pointer :: &
3636
T_Restore(:,:) => NULL(), & !< The temperature to restore the SST toward [degC].
3737
S_Restore(:,:) => NULL(), & !< The salinity to restore the sea surface salnity toward [ppt]
@@ -61,7 +61,7 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
6161
type(forcing), intent(inout) :: fluxes !< A structure containing thermodynamic forcing fields
6262
type(time_type), intent(in) :: day !< The time of the fluxes
6363
real, intent(in) :: dt !< The amount of time over which
64-
!! the fluxes apply [s]
64+
!! the fluxes apply [T ~> s]
6565
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
6666
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
6767
type(MESO_surface_forcing_CS), pointer :: CS !< A pointer to the control structure returned by
@@ -138,7 +138,7 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
138138
! Set whichever fluxes are to be used here. Any fluxes that
139139
! are always zero do not need to be changed here.
140140
do j=js,je ; do i=is,ie
141-
! Fluxes of fresh water through the surface are in units of [kg m-2 s-1]
141+
! Fluxes of fresh water through the surface are in units of [R Z T-1 ~> kg m-2 s-1]
142142
! and are positive downward - i.e. evaporation should be negative.
143143
fluxes%evap(i,j) = -0.0 * G%mask2dT(i,j)
144144
fluxes%lprec(i,j) = CS%PmE(i,j) * CS%Rho0 * G%mask2dT(i,j)
@@ -215,8 +215,8 @@ subroutine MESO_surface_forcing_init(Time, G, US, param_file, diag, CS)
215215
type(MESO_surface_forcing_CS), pointer :: CS !< A pointer that is set to point to the
216216
!! control structure for this module
217217

218-
! This include declares and sets the variable "version".
219-
#include "version_variable.h"
218+
! This include declares and sets the variable "version".
219+
# include "version_variable.h"
220220
character(len=40) :: mdl = "MESO_surface_forcing" ! This module's name.
221221

222222
if (associated(CS)) then

0 commit comments

Comments
 (0)