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

new loss term for internal waves: scattering to higher modes #33

Closed
wants to merge 98 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
36d4f7f
Bugfix: cpu clock sync error
marshallward Dec 4, 2021
e48f4a7
+Add the new routine unit_no_scaling_init
Hallberg-NOAA Dec 6, 2021
59c5926
(*)Provide US arguments to 4 existing calls
Hallberg-NOAA Dec 6, 2021
3162bd0
+Make US arguments non-optional for 28 routines
Hallberg-NOAA Dec 6, 2021
763ddab
Docs: Add NASA-GMAO to consortium figure
marshallward Dec 6, 2021
582de2e
add infrastructure for residual term
Nov 29, 2021
196586d
add residual term loss on flux
Dec 8, 2021
6807892
clean up/ move to implicit update
Dec 8, 2021
3ce6a31
Merge branch 'dev/gfdl' into cpu_clock_sync_bugfix
Hallberg-NOAA Dec 9, 2021
833cd30
+Remove clocks inside of j-loops
Hallberg-NOAA Dec 5, 2021
8b5c1c8
Deallocate eta_PF_start to avoid a memory leak
Hallberg-NOAA Dec 5, 2021
3f46b6a
+Set find_salt_root if SHELF_THREE_EQN = .False.
Hallberg-NOAA Dec 5, 2021
ec553aa
+Obsolete ETA_TOLERANCE_AUX
Hallberg-NOAA Dec 5, 2021
d733714
(*)Fix extract_diabatic_member
Hallberg-NOAA Dec 10, 2021
5172c49
Warn if opacity_from_chl is called without fluxes
Hallberg-NOAA Dec 10, 2021
90739be
Correct comments describing advect_tracer args
Hallberg-NOAA Dec 10, 2021
3364af1
Update indexing of array passed to data_override.
wfcooke Dec 6, 2021
2319139
Correct out of bounds index (por_face_areaU) bug
Hallberg-NOAA Dec 7, 2021
05edb63
(*)Offline tracer read bug fix
Hallberg-NOAA Dec 10, 2021
fcfd238
+Refactored and rescaled the offline tracer code
Hallberg-NOAA Dec 11, 2021
09bcea2
Merge branch 'dev/gfdl' into cpu_clock_sync_bugfix
Hallberg-NOAA Dec 11, 2021
112ac49
+(*)Revised offline tracer algorithms
Hallberg-NOAA Dec 11, 2021
0895fe3
Merge branch 'dev/gfdl' into offline_tracer_fix
Hallberg-NOAA Dec 11, 2021
fbafcb1
Merge branch 'dev/gfdl' into mandatory_US_args
Hallberg-NOAA Dec 11, 2021
86b91dc
Merge pull request #29 from Hallberg-NOAA/mandatory_US_args
marshallward Dec 12, 2021
e452a29
Merge branch 'dev/gfdl' into cpu_clock_sync_bugfix
Hallberg-NOAA Dec 12, 2021
7ae28b8
Merge pull request #27 from marshallward/cpu_clock_sync_bugfix
Hallberg-NOAA Dec 13, 2021
8824671
Merge branch 'dev/gfdl' into consortium_fig_update
Hallberg-NOAA Dec 13, 2021
8f5dc28
Merge pull request #31 from marshallward/consortium_fig_update
Hallberg-NOAA Dec 13, 2021
cf931b1
Eliminate unneeded diagnostic arrays
Hallberg-NOAA Dec 9, 2021
170fffd
MOM_sponge cleanup
Hallberg-NOAA Dec 9, 2021
6feadd0
Use G%Rad_Earth_L in mct and NUOPC cap code
Hallberg-NOAA Dec 11, 2021
bbb9753
+Rescale some sea-surface height variables to [Z]
Hallberg-NOAA Dec 11, 2021
86eb106
Correct the units in two comments
Hallberg-NOAA Dec 15, 2021
049241c
+Rescaled optics%opacity_band
Hallberg-NOAA Dec 16, 2021
08cd63b
Merge branch 'dev/gfdl' into opacity_rescale
Hallberg-NOAA Dec 16, 2021
0544f9f
+(*)Avoid segmentation faults if PEN_SW_NBANDS = 0
Hallberg-NOAA Dec 16, 2021
50df270
Ice dynamics (#35)
OlgaSergienko Dec 17, 2021
12f29f6
Adding temperature restore capability for SPEAR. (#36)
wfcooke Dec 18, 2021
a902e75
+Add US args and rescale dt arg to generic tracers
Hallberg-NOAA Dec 13, 2021
9cb9304
EMC stochastic candidate 20211028 (#1538)
jiandewang Dec 20, 2021
986bc8c
Corrected the unit documentation for 31 variables
Hallberg-NOAA Dec 14, 2021
d244246
+Rescale tides and ramp-up times
Hallberg-NOAA Dec 14, 2021
9a5e218
Merge branch 'main' into main_to_dev_gfdl
marshallward Dec 21, 2021
bf43fd8
Merge pull request #47 from marshallward/main_to_dev_gfdl
adcroft Dec 21, 2021
5d4e8a1
(*)Removed problematic offline tracer lines
Hallberg-NOAA Dec 22, 2021
dad675a
Fix badge URL for codecov
adcroft Dec 22, 2021
34554d0
Merge branch 'dev/gfdl' into offline_tracer_fix
Hallberg-NOAA Dec 22, 2021
e3c0b72
Merge branch 'dev/gfdl' into offline_tracer_fix
Hallberg-NOAA Dec 22, 2021
f35edbd
Bugfix - calculate density integrals in ALE mode w/ pressure_reconstr…
MJHarrison-GFDL Dec 17, 2021
f865b24
Update MOM_PressureForce_FV.F90
marshallward Dec 23, 2021
b628748
Correct comments describing generic_tracer args
Hallberg-NOAA Dec 16, 2021
6bcea76
Fixes an uninitialized logical in FMS_cap
adcroft Dec 22, 2021
d9d82e3
Eliminate unneeded diagnostic arrays in CorAdCalc
Hallberg-NOAA Dec 23, 2021
a8a2039
Merge branch 'dev/gfdl' into opacity_rescale
Hallberg-NOAA Dec 27, 2021
1028ee0
Merge pull request #43 from Hallberg-NOAA/opacity_rescale
marshallward Dec 29, 2021
c32ec97
Merge branch 'dev/gfdl' into offline_tracer_fix
Hallberg-NOAA Dec 29, 2021
5ad8a2c
Deleted commented out offline tracer lines
Hallberg-NOAA Dec 29, 2021
2b2214d
(*)Use por_face_area in zonal_face_thickness
Hallberg-NOAA Dec 23, 2021
e5a5407
Merge branch 'dev/gfdl' into offline_tracer_fix
marshallward Dec 29, 2021
71cf831
Merge pull request #37 from Hallberg-NOAA/offline_tracer_fix
marshallward Dec 29, 2021
2d32631
Option to homogenize forces and fluxes (#51)
breichl Jan 3, 2022
df46be4
Hydrostatic initialization in ice cavities (#41)
MJHarrison-GFDL Jan 6, 2022
f7a2254
Rewrite horizontal regridding to use netCDF wrapper functions (#48)
marshallward Jan 8, 2022
d838ccd
Clean up non-standard syntax and whitespace
Hallberg-NOAA Jan 8, 2022
6da5c9b
Standardize code in calc_sfc_displacement
Hallberg-NOAA Jan 8, 2022
9f0018f
+(*)Change the remapping dzInterface argument sign
Hallberg-NOAA Jan 18, 2022
03a247e
Avoid divide by zero in horizontal_viscosity() with better_bound_kh
adcroft Jan 21, 2022
e63c405
Fix soft-conventional index capitalization in horizontal_viscosity()
adcroft Jan 21, 2022
65998cd
Esmg docs (#57)
kshedstrom Jan 26, 2022
3f58f8a
read_variable_2d modified to accept 3 or 4 dims
marshallward Feb 3, 2022
56401b6
+Add MOM_check_scaling.F90 and MOM_scaling_check.F90
Hallberg-NOAA Dec 22, 2021
75bf521
+Move MOM_scaling_check.F90 to MOM_unique_scales.F90
Hallberg-NOAA Jan 24, 2022
64f432f
Diabatic driver: energetic_PBL -> ePBL, flag check
marshallward Feb 16, 2022
fc5253f
(*)Correct memory declarations in MOM_regridding
Hallberg-NOAA Jan 24, 2022
c166358
Add optional argument to FMS2 version of get_field_size
MJHarrison-GFDL Feb 1, 2022
e841609
remove unnecessary optional flag
MJHarrison-GFDL Feb 2, 2022
6f6d4d6
Merge pull request #1556 from NOAA-GFDL/dev-gfdl-main-candidate-2022-…
marshallward Feb 17, 2022
5f56798
Merge branch 'main' into main_to_dev
marshallward Feb 18, 2022
32e1ecf
Fixes issues with the GME code and get_param calls for Leith options …
gustavo-marques Feb 20, 2022
149073f
Remove hard-wired parameter in adjustEtaToFitBathymetry (#69)
gustavo-marques Feb 20, 2022
712ff9e
Merge branch 'dev/gfdl' into main_to_dev
Hallberg-NOAA Feb 20, 2022
2e72b88
Merge pull request #71 from NOAA-GFDL/main_to_dev
Hallberg-NOAA Feb 21, 2022
d46dbc7
Report mean temperature from MOM_state_stats()
Hallberg-NOAA Dec 16, 2021
9c7bf29
+Add global_mass_int_EFP
Hallberg-NOAA Dec 16, 2021
8197cea
Use global_mass_integral in lateral_bdry_diff
Hallberg-NOAA Dec 16, 2021
1bf8220
(*)+Reproducing tracer stocks
Hallberg-NOAA Dec 16, 2021
a0d0238
(*)+Use reproducing stocks for all tracer packages
Hallberg-NOAA Feb 21, 2022
a468bee
Removed trailing white space
Hallberg-NOAA Feb 23, 2022
9caa701
(+) Refactor of MOM_file_parser
marshallward Feb 23, 2022
cf193a8
Merge pull request #74 from marshallward/file_parser_refactor
Hallberg-NOAA Feb 28, 2022
9a01cd5
+Add ALE options mimicking Hycom
Hallberg-NOAA Feb 26, 2022
4640461
(*)Avoid negative thicknesses in mixed_layer_restrat
Hallberg-NOAA Feb 24, 2022
dadd182
add infrastructure for residual term
Nov 29, 2021
b671a87
add residual term loss on flux
Dec 8, 2021
46d292c
clean up/ move to implicit update
Dec 8, 2021
0120792
parenthesis
Mar 9, 2022
6a208f1
Merge branch 'residualIW' of github.com:raphaeldussin/MOM6 into resid…
Mar 9, 2022
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
Prev Previous commit
Next Next commit
+Add the new routine unit_no_scaling_init
  Added the public interface unit_no_scaling_init() to the MOM_unit_scaling
module to initialize a non-scaling unit_scale_type without requiring a
param_file_type argument.  This should be useful for certain trivial unit tests,
and it makes it more plausible to make the unit_scale_type arguments mandatory.
As a part of this change, the new internal subroutine set_unit_scaling_combos()
was carved out of unit_scaling_init to avoid code duplication.  Also added
comments describing the effective units of the various scaling factors with the
standard MOM6 notation.  All answers and output are bitwise identical.
Hallberg-NOAA committed Dec 6, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e48f4a7f42f4e28cc5ac2b2dee5327617eeedec2
93 changes: 63 additions & 30 deletions src/framework/MOM_unit_scaling.F90
Original file line number Diff line number Diff line change
@@ -8,39 +8,47 @@ module MOM_unit_scaling

implicit none ; private

public unit_scaling_init, unit_scaling_end, fix_restart_unit_scaling
! A note on unit descriptions in comments: MOM6 uses units that can be rescaled for dimensional
! consistency testing. These are noted in comments with units like Z, H, L, T, R and Q, along with
! their mks counterparts with notation like "a velocity [Z T-1 ~> m s-1]". If the rescaled
! combination is a nondimensional variable, the notation would be "a slope [Z L-1 ~> nondim]",
! but if (as the case for the variables here), the rescaled combination is exactly 1, the right
! notation would be something like "a dimensional scaling factor [Z m-1 ~> 1]". If the units
! vary with the Boussinesq approximation, the Boussinesq variant is given first.

public unit_scaling_init, unit_no_scaling_init, unit_scaling_end, fix_restart_unit_scaling

!> Describes various unit conversion factors
type, public :: unit_scale_type
real :: m_to_Z !< A constant that translates distances in meters to the units of depth.
real :: Z_to_m !< A constant that translates distances in the units of depth to meters.
real :: m_to_L !< A constant that translates lengths in meters to the units of horizontal lengths.
real :: L_to_m !< A constant that translates lengths in the units of horizontal lengths to meters.
real :: s_to_T !< A constant that translates time intervals in seconds to the units of time.
real :: T_to_s !< A constant that translates the units of time to seconds.
real :: R_to_kg_m3 !< A constant that translates the units of density to kilograms per meter cubed.
real :: kg_m3_to_R !< A constant that translates kilograms per meter cubed to the units of density.
real :: Q_to_J_kg !< A constant that translates the units of enthalpy to Joules per kilogram.
real :: J_kg_to_Q !< A constant that translates Joules per kilogram to the units of enthalpy.
real :: m_to_Z !< A constant that translates distances in meters to the units of depth [Z m-1 ~> 1]
real :: Z_to_m !< A constant that translates distances in the units of depth to meters [m Z-1 ~> 1]
real :: m_to_L !< A constant that translates lengths in meters to the units of horizontal lengths [L m-1 ~> 1]
real :: L_to_m !< A constant that translates lengths in the units of horizontal lengths to meters [m L-1 ~> 1]
real :: s_to_T !< A constant that translates time intervals in seconds to the units of time [T s-1 ~> 1]
real :: T_to_s !< A constant that translates the units of time to seconds [s T-1 ~> 1]
real :: R_to_kg_m3 !< A constant that translates the units of density to kilograms per meter cubed [kg m-3 R-1 ~> 1]
real :: kg_m3_to_R !< A constant that translates kilograms per meter cubed to the units of density [R m3 kg-1 ~> 1]
real :: Q_to_J_kg !< A constant that translates the units of enthalpy to Joules per kilogram [J kg-1 Q-1 ~> 1]
real :: J_kg_to_Q !< A constant that translates Joules per kilogram to the units of enthalpy [Q kg J-1 ~> 1]

! These are useful combinations of the fundamental scale conversion factors above.
real :: Z_to_L !< Convert vertical distances to lateral lengths
real :: L_to_Z !< Convert lateral lengths to vertical distances
real :: L_T_to_m_s !< Convert lateral velocities from L T-1 to m s-1.
real :: m_s_to_L_T !< Convert lateral velocities from m s-1 to L T-1.
real :: L_T2_to_m_s2 !< Convert lateral accelerations from L T-2 to m s-2.
real :: Z2_T_to_m2_s !< Convert vertical diffusivities from Z2 T-1 to m2 s-1.
real :: m2_s_to_Z2_T !< Convert vertical diffusivities from m2 s-1 to Z2 T-1.
real :: W_m2_to_QRZ_T !< Convert heat fluxes from W m-2 to Q R Z T-1.
real :: QRZ_T_to_W_m2 !< Convert heat fluxes from Q R Z T-1 to W m-2.
! Not used enough: real :: kg_m2_to_RZ !< Convert mass loads from kg m-2 to R Z.
real :: RZ_to_kg_m2 !< Convert mass loads from R Z to kg m-2.
real :: kg_m2s_to_RZ_T !< Convert mass fluxes from kg m-2 s-1 to R Z T-1.
real :: RZ_T_to_kg_m2s !< Convert mass fluxes from R Z T-1 to kg m-2 s-1.
real :: RZ3_T3_to_W_m2 !< Convert turbulent kinetic energy fluxes from R Z3 T-3 to W m-2.
real :: W_m2_to_RZ3_T3 !< Convert turbulent kinetic energy fluxes from W m-2 to R Z3 T-3.
real :: RL2_T2_to_Pa !< Convert pressures from R L2 T-2 to Pa.
! Not used enough: real :: Pa_to_RL2_T2 !< Convert pressures from Pa to R L2 T-2.
real :: Z_to_L !< Convert vertical distances to lateral lengths [L Z-1 ~> 1]
real :: L_to_Z !< Convert lateral lengths to vertical distances [Z L-1 ~> 1]
real :: L_T_to_m_s !< Convert lateral velocities from L T-1 to m s-1 [T m L-1 s-1 ~> 1]
real :: m_s_to_L_T !< Convert lateral velocities from m s-1 to L T-1 [L s T-1 m-1 ~> 1]
real :: L_T2_to_m_s2 !< Convert lateral accelerations from L T-2 to m s-2 [L s2 T-2 m-1 ~> 1]
real :: Z2_T_to_m2_s !< Convert vertical diffusivities from Z2 T-1 to m2 s-1 [T1 m2 Z-2 s-1 ~> 1]
real :: m2_s_to_Z2_T !< Convert vertical diffusivities from m2 s-1 to Z2 T-1 [Z2 s T-1 m-2 ~> 1]
real :: W_m2_to_QRZ_T !< Convert heat fluxes from W m-2 to Q R Z T-1 [Q R Z m2 T-1 W-1 ~> 1]
real :: QRZ_T_to_W_m2 !< Convert heat fluxes from Q R Z T-1 to W m-2 [W T Q-1 R-1 Z-1 m-2 ~> 1]
! Not used enough: real :: kg_m2_to_RZ !< Convert mass loads from kg m-2 to R Z [R Z m2 kg-1 ~> 1]
real :: RZ_to_kg_m2 !< Convert mass loads from R Z to kg m-2 [kg R-1 Z-1 m-2 ~> 1]
real :: kg_m2s_to_RZ_T !< Convert mass fluxes from kg m-2 s-1 to R Z T-1 [R Z m2 s T-1 kg-1 ~> 1]
real :: RZ_T_to_kg_m2s !< Convert mass fluxes from R Z T-1 to kg m-2 s-1 [T kg R-1 Z-1 m-2 s-1 ~> 1]
real :: RZ3_T3_to_W_m2 !< Convert turbulent kinetic energy fluxes from R Z3 T-3 to W m-2 [W T3 R-1 Z-3 m-2 ~> 1]
real :: W_m2_to_RZ3_T3 !< Convert turbulent kinetic energy fluxes from W m-2 to R Z3 T-3 [R Z3 m2 T-3 W-1 ~> 1]
real :: RL2_T2_to_Pa !< Convert pressures from R L2 T-2 to Pa [Pa T2 R-1 L-2 ~> 1]
! Not used enough: real :: Pa_to_RL2_T2 !< Convert pressures from Pa to R L2 T-2 [R L2 T-2 Pa-1 ~> 1]

! These are used for changing scaling across restarts.
real :: m_to_Z_restart = 0.0 !< A copy of the m_to_Z that is used in restart files.
@@ -130,7 +138,32 @@ subroutine unit_scaling_init( param_file, US )
US%Q_to_J_kg = 1.0 * Q_Rescale_factor
US%J_kg_to_Q = 1.0 / Q_Rescale_factor

! These are useful combinations of the fundamental scale conversion factors set above.
call set_unit_scaling_combos(US)
end subroutine unit_scaling_init

!> Allocates and initializes the ocean model unit scaling type to unscaled values.
subroutine unit_no_scaling_init(US)
type(unit_scale_type), pointer :: US !< A dimensional unit scaling type

if (associated(US)) call MOM_error(FATAL, &
'unit_scaling_init: called with an associated US pointer.')
allocate(US)

US%Z_to_m = 1.0 ; US%m_to_Z = 1.0
US%L_to_m = 1.0 ; US%m_to_L = 1.0
US%T_to_s = 1.0 ; US%s_to_T = 1.0
US%R_to_kg_m3 = 1.0 ; US%kg_m3_to_R = 1.0
US%Q_to_J_kg = 1.0 ; US%J_kg_to_Q = 1.0

call set_unit_scaling_combos(US)
end subroutine unit_no_scaling_init

!> This subroutine sets useful combinations of the fundamental scale conversion factors
!! in the unit scaling type.
subroutine set_unit_scaling_combos(US)
type(unit_scale_type), intent(inout) :: US !< A dimensional unit scaling type

! Convert vertical to horizontal length scales and the reverse:
US%Z_to_L = US%Z_to_m * US%m_to_L
US%L_to_Z = US%L_to_m * US%m_to_Z
! Horizontal velocities:
@@ -159,7 +192,7 @@ subroutine unit_scaling_init( param_file, US )
! It does not seem like US%Pa_to_RL2_T2 would be used enough in MOM6 to justify its existence.
! US%Pa_to_RL2_T2 = US%kg_m3_to_R * US%m_s_to_L_T**2

end subroutine unit_scaling_init
end subroutine set_unit_scaling_combos

!> Set the unit scaling factors for output to restart files to the unit scaling
!! factors for this run.