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

WIP #1

Merged
merged 56 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
40c2043
Merge remote-tracking branch 'gfdl/dev/gfdl' into oblique_fuss
kshedstrom Jul 10, 2018
106b3e0
Merge remote-tracking branch 'gfdl/dev/gfdl' into oblique_fuss
kshedstrom Jul 12, 2018
50b850d
Corrected two openMP directives
Hallberg-NOAA Jul 13, 2018
ad3961c
Time-filter on oblique OBCs.
kshedstrom Jul 15, 2018
12410a1
Fix nudging with oblique OBCs.
kshedstrom Jul 19, 2018
e0ca46b
+Added stress_mag to ice_ocean_boundary_type
Hallberg-NOAA Jul 20, 2018
b2b8bf7
Merge pull request #821 from Hallberg-NOAA/correct_openMP
adcroft Jul 23, 2018
d3b63db
Merge branch 'dev/esmg' of https://github.com/ESMG/MOM6 into ESMG-dev…
adcroft Jul 23, 2018
f738996
Merge branch 'ESMG-dev/esmg' into dev/gfdl
adcroft Jul 23, 2018
3248505
Merge pull request #825 from Hallberg-NOAA/add_stress_mag
adcroft Jul 23, 2018
7030e56
Merge branch 'dev/master' into dev/gfdl
adcroft Jul 26, 2018
8d794ef
Adding OBLIQUE_TAN and OBLIQUE_GRAD options.
kshedstrom Aug 1, 2018
53cd176
Merge remote-tracking branch 'gfdl/dev/gfdl' into dev/esmg
kshedstrom Aug 1, 2018
c95d513
+Use stress_mag to set ustar
Hallberg-NOAA Aug 3, 2018
e1762f5
+Added extract_IOB_stresses
Hallberg-NOAA Aug 3, 2018
4b859d4
Always set G%Domain_aux
Hallberg-NOAA Aug 3, 2018
7507e2d
Set stresses via extract_IOB_stresses
Hallberg-NOAA Aug 3, 2018
0d18946
Code cleanup in MOM_surface_forcing.F90
Hallberg-NOAA Aug 3, 2018
b15f514
Set ustar in fluxes via extract_IOB_stresses
Hallberg-NOAA Aug 6, 2018
f20c3f1
+Changed interface to forcing_accumulate
Hallberg-NOAA Aug 6, 2018
c02b134
(+)Restored the interface to forcing_accumulate
Hallberg-NOAA Aug 6, 2018
13f9303
+Added optional arguments to convert_IOB_to_forces
Hallberg-NOAA Aug 7, 2018
5f253d4
Consolidate dynamic & thermodynamic forcing setup
Hallberg-NOAA Aug 7, 2018
c54a25a
(*)Allow for fractional second coupling timesteps
Hallberg-NOAA Aug 7, 2018
d9e9457
Use real_to_time_type in 63+year segment clock cor
Hallberg-NOAA Aug 7, 2018
974662e
Corrected description of SINGLE_STEPPING_CALL
Hallberg-NOAA Aug 7, 2018
171e0c8
Merge pull request #1 from NOAA-GFDL/dev/gfdl
wrongkindofdoctor Aug 8, 2018
a30575d
+Added APPROX_NET_MASS_SRC & moved RESTORE_SALINITY
Hallberg-NOAA Aug 8, 2018
6c46811
+Removed forcing type arg from mech_forcing_diags
Hallberg-NOAA Aug 8, 2018
0cb2d87
removed underscore from allocated statement in MOM_generic_tracer_col…
Aug 9, 2018
3beec78
Merge pull request #826 from ESMG/dev/esmg
Hallberg-NOAA Aug 9, 2018
0bd8688
Allocate surface tracers on the compute domain instead of the
menzel-gfdl Aug 9, 2018
593b2d1
Merge pull request #828 from raymenzel/dev/gfdl
Hallberg-NOAA Aug 10, 2018
c4529f3
+Added optional arguments to updaet_ocean_model
Hallberg-NOAA Aug 10, 2018
835c357
Merge branch 'dev/gfdl' into use_stress_mag
Hallberg-NOAA Aug 11, 2018
4046615
Removed trailing white space
Hallberg-NOAA Aug 11, 2018
3bf78bd
Avoid NaNs on land in ALE diagnostics
Hallberg-NOAA Aug 13, 2018
ac757ef
Capitalized _allocated in MOM_generic tracer to fix bug with intel16 …
Aug 14, 2018
e3dc939
(*)Increase precision of time handling
Hallberg-NOAA Aug 14, 2018
5f6384c
(*)Corrected time units in MOM6 restart files
Hallberg-NOAA Aug 14, 2018
f579e9e
+(*)Add real_to_time
Hallberg-NOAA Aug 15, 2018
97479d8
(*)Use real_to_time
Hallberg-NOAA Aug 15, 2018
29cd16b
Merge pull request #832 from wrongkindofdoctor/user/jml/capitalize_al…
Hallberg-NOAA Aug 15, 2018
dba64e8
Fix to soliton initialization.
kshedstrom Aug 15, 2018
22fbe6f
Fix soliton initialization with GV%m_to_H
kshedstrom Aug 15, 2018
d1df0c4
Merge pull request #831 from Hallberg-NOAA/fix_ALE_diag_init
adcroft Aug 16, 2018
9324655
Merge pull request #833 from Hallberg-NOAA/better_time_precision
adcroft Aug 16, 2018
773902a
Merge pull request #834 from ESMG/dev/esmg
Hallberg-NOAA Aug 16, 2018
1bd762d
Merge branch 'dev/gfdl' into use_stress_mag
Hallberg-NOAA Aug 16, 2018
731f2cf
Eliminated unused variables in forcing modules
Hallberg-NOAA Aug 16, 2018
904b5fe
+Removed MESO_wind_forcing
Hallberg-NOAA Aug 16, 2018
396e193
(*)Use real_to_time in driver code
Hallberg-NOAA Aug 16, 2018
85c5dda
Merge branch 'Hallberg-NOAA-use_stress_mag' into dev/gfdl
adcroft Aug 17, 2018
ab6a73b
Merge remote-tracking branch 'NOAA-GFDL/MOM6/dev/gfdl' into dev/gfdl
menzel-gfdl Aug 21, 2018
9252394
Reordered loops to address a bug when compiled with -O3 using the
menzel-gfdl Aug 21, 2018
e3ea419
Fixed logic, made ifs one-liners.
menzel-gfdl Aug 21, 2018
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
679 changes: 410 additions & 269 deletions config_src/coupled_driver/MOM_surface_forcing.F90

Large diffs are not rendered by default.

292 changes: 140 additions & 152 deletions config_src/coupled_driver/ocean_model_MOM.F90

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1790,8 +1790,7 @@ subroutine update_ocean_model(OS, Ocean_sfc, time_start_update, &
OS%nstep = OS%nstep + 1

call enable_averaging(time_step, OS%Time, OS%diag)
call mech_forcing_diags(OS%forces, OS%fluxes, time_step, OS%grid, &
OS%diag, OS%forcing_CSp%handles)
call mech_forcing_diags(OS%forces, time_step, OS%grid, OS%diag, OS%forcing_CSp%handles)
call disable_averaging(OS%diag)

if (OS%fluxes%fluxes_used) then
Expand Down
95 changes: 2 additions & 93 deletions config_src/solo_driver/MESO_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ module MESO_surface_forcing
use MOM_forcing_type, only : allocate_forcing_type, allocate_mech_forcing
use MOM_grid, only : ocean_grid_type
use MOM_io, only : file_exists, MOM_read_data, slasher
use MOM_time_manager, only : time_type, operator(+), operator(/), get_time
use MOM_time_manager, only : time_type, operator(+), operator(/)
use MOM_tracer_flow_control, only : call_tracer_set_forcing
use MOM_tracer_flow_control, only : tracer_flow_control_CS
use MOM_variables, only : surface

implicit none ; private

public MESO_wind_forcing, MESO_buoyancy_forcing, MESO_surface_forcing_init
public MESO_buoyancy_forcing, MESO_surface_forcing_init

!> This control structure is used to store parameters associated with the MESO forcing.
type, public :: MESO_surface_forcing_CS ; private
Expand Down Expand Up @@ -52,71 +52,6 @@ module MESO_surface_forcing

contains

!### This subroutine sets zero surface wind stresses, but it is not even
!### used by the MESO experimeents. This subroutine can be deleted. -RWH
subroutine MESO_wind_forcing(sfc_state, forces, day, G, CS)
type(surface), intent(inout) :: sfc_state !< A structure containing fields that
!! describe the surface state of the ocean.
type(mech_forcing), intent(inout) :: forces !< A structure with the driving mechanical forces
type(time_type), intent(in) :: day !< The time of the fluxes
type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
type(MESO_surface_forcing_CS), pointer :: CS !< A pointer to the control structure returned by a previous
!! call to MESO_surface_forcing_init

! This subroutine sets the surface wind stresses, forces%taux and forces%tauy.
! These are the stresses in the direction of the model grid (i.e. the same
! direction as the u- and v- velocities.) They are both in Pa.
! In addition, this subroutine can be used to set the surface friction
! velocity, forces%ustar, in m s-1. This is needed with a bulk mixed layer.
!
! Arguments: state - A structure containing fields that describe the
! surface state of the ocean.
! (out) fluxes - A structure containing pointers to any possible
! forcing fields. Unused fields have NULL ptrs.
! (in) day - Time of the fluxes.
! (in) G - The ocean's grid structure.
! (in) CS - A pointer to the control structure returned by a previous
! call to MESO_surface_forcing_init

integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB

! When modifying the code, comment out this error message. It is here
! so that the original (unmodified) version is not accidentally used.
call MOM_error(FATAL, "MESO_wind_surface_forcing: " // &
"User forcing routine called without modification." )

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB

! Allocate the forcing arrays, if necessary.
call allocate_mech_forcing(G, forces, stress=.true., ustar=.true.)

! Set the surface wind stresses, in units of Pa. A positive taux
! accelerates the ocean to the (pseudo-)east.

! The i-loop extends to is-1 so that taux can be used later in the
! calculation of ustar - otherwise the lower bound would be Isq.
do j=js,je ; do I=is-1,Ieq
forces%taux(I,j) = G%mask2dCu(I,j) * 0.0 ! Change this to the desired expression.
enddo ; enddo
do J=js-1,Jeq ; do i=is,ie
forces%tauy(i,J) = G%mask2dCv(i,J) * 0.0 ! Change this to the desired expression.
enddo ; enddo

! Set the surface friction velocity, in units of m s-1. ustar
! is always positive.
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
! This expression can be changed if desired, but need not be.
forces%ustar(i,j) = G%mask2dT(i,j) * sqrt(CS%gust_const/CS%Rho0 + &
sqrt(0.5*(forces%taux(I-1,j)**2 + forces%taux(I,j)**2) + &
0.5*(forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2))/CS%Rho0)
enddo ; enddo ; endif

end subroutine MESO_wind_forcing

!> This subroutine sets up the MESO buoyancy forcing, which uses control-theory style
!! specification restorative buoyancy fluxes at large scales.
subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS)
Expand All @@ -130,10 +65,6 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS)
type(MESO_surface_forcing_CS), pointer :: CS !< A pointer to the control structure returned by
!! a previous call to MESO_surface_forcing_init

! This subroutine specifies the current surface fluxes of buoyancy or
! temperature and fresh water. It may also be modified to add
! surface fluxes of user provided tracers.

! When temperature is used, there are long list of fluxes that need to be
! set - essentially the same as for a full coupled model, but most of these
! can be simply set to zero. The net fresh water flux should probably be
Expand All @@ -144,17 +75,6 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS)
! are in W m-2 and positive for heat going into the ocean. All fresh water
! fluxes are in kg m-2 s-1 and positive for water moving into the ocean.

! Arguments: state - A structure containing fields that describe the
! surface state of the ocean.
! (out) fluxes - A structure containing pointers to any possible
! forcing fields. Unused fields have NULL ptrs.
! (in) day_start - Start time of the fluxes.
! (in) day_interval - Length of time over which these fluxes
! will be applied.
! (in) G - The ocean's grid structure.
! (in) CS - A pointer to the control structure returned by a previous
! call to MESO_surface_forcing_init

real :: Temp_restore ! The temperature that is being restored toward, in C.
real :: Salin_restore ! The salinity that is being restored toward, in PSU.
real :: density_restore ! The potential density that is being restored
Expand Down Expand Up @@ -293,14 +213,6 @@ subroutine MESO_surface_forcing_init(Time, G, param_file, diag, CS)
type(MESO_surface_forcing_CS), pointer :: CS !< A pointer that is set to point to the
!! control structure for this module

! Arguments: Time - The current model time.
! (in) G - The ocean's grid structure.
! (in) param_file - A structure indicating the open file to parse for
! model parameter values.
! (in) diag - A structure that is used to regulate diagnostic output.
! (in/out) CS - A pointer that is set to point to the control structure
! for this module

! This include declares and sets the variable "version".
#include "version_variable.h"
character(len=40) :: mdl = "MESO_surface_forcing" ! This module's name.
Expand Down Expand Up @@ -383,9 +295,6 @@ end subroutine MESO_surface_forcing_init
!! it is probably a good idea to read the forcing from input files
!! using "file" for WIND_CONFIG and BUOY_CONFIG.
!!
!! MESO_wind_forcing should set the surface wind stresses (taux and
!! tauy) perhaps along with the surface friction velocity (ustar).
!!
!! MESO_buoyancy forcing is used to set the surface buoyancy
!! forcing, which may include a number of fresh water flux fields
!! (evap, liq_precip, froz_precip, liq_runoff, froz_runoff, and
Expand Down
38 changes: 19 additions & 19 deletions config_src/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ program MOM_main
use MOM_string_functions,only : uppercase
use MOM_surface_forcing, only : set_forcing, forcing_save_restart
use MOM_surface_forcing, only : surface_forcing_init, surface_forcing_CS
use MOM_time_manager, only : time_type, set_date, set_time, get_date, time_type_to_real
use MOM_time_manager, only : time_type, set_date, get_date
use MOM_time_manager, only : real_to_time, time_type_to_real
use MOM_time_manager, only : operator(+), operator(-), operator(*), operator(/)
use MOM_time_manager, only : operator(>), operator(<), operator(>=)
use MOM_time_manager, only : increment_date, set_calendar_type, month_name
Expand Down Expand Up @@ -137,7 +138,7 @@ program MOM_main
real :: dt_dyn, dtdia, t_elapsed_seg
integer :: n, n_max, nts, n_last_thermo
logical :: diabatic_first, single_step_call
type(time_type) :: Time2
type(time_type) :: Time2, time_chg

integer :: Restart_control ! An integer that is bit-tested to determine whether
! incremental restart files are saved and whether they
Expand Down Expand Up @@ -290,7 +291,7 @@ program MOM_main
Start_time = set_date(date_init(1),date_init(2), date_init(3), &
date_init(4),date_init(5),date_init(6))
else
Start_time = set_time(0,days=0)
Start_time = real_to_time(0.0)
endif

call time_interp_external_init
Expand Down Expand Up @@ -356,7 +357,7 @@ program MOM_main
endif
ntstep = MAX(1,ceiling(dt_forcing/dt - 0.001))

Time_step_ocean = set_time(int(floor(dt_forcing+0.5)))
Time_step_ocean = real_to_time(dt_forcing)
elapsed_time_master = (abs(dt_forcing - time_type_to_real(Time_step_ocean)) > 1.0e-12*dt_forcing)
if (elapsed_time_master) &
call MOM_mesg("Using real elapsed time for the master clock.", 2)
Expand Down Expand Up @@ -415,7 +416,7 @@ program MOM_main
call get_param(param_file, mod_name, "RESTINT", restint, &
"The interval between saves of the restart file in units \n"//&
"of TIMEUNIT. Use 0 (the default) to not save \n"//&
"incremental restart files at all.", default=set_time(0), &
"incremental restart files at all.", default=real_to_time(0.0), &
timeunit=Time_unit)
call get_param(param_file, mod_name, "WRITE_CPU_STEPS", cpu_steps, &
"The number of coupled timesteps between writing the cpu \n"//&
Expand Down Expand Up @@ -454,7 +455,7 @@ program MOM_main
if (((.not.BTEST(Restart_control,1)) .and. (.not.BTEST(Restart_control,0))) &
.or. (Restart_control < 0)) permit_incr_restart = .false.

if (restint > set_time(0)) then
if (restint > real_to_time(0.0)) then
! restart_time is the next integral multiple of restint.
restart_time = Start_time + restint * &
(1 + ((Time + Time_step_ocean) - Start_time) / restint)
Expand Down Expand Up @@ -532,7 +533,7 @@ program MOM_main
dtdia = dt_dyn*(n - n_last_thermo)
! Back up Time2 to the start of the thermodynamic segment.
if (n > n_last_thermo+1) &
Time2 = Time2 - set_time(int(floor((dtdia - dt_dyn) + 0.5)))
Time2 = Time2 - real_to_time(dtdia - dt_dyn)
call step_MOM(forces, fluxes, sfc_state, Time2, dtdia, MOM_CSp, &
do_dynamics=.false., do_thermodynamics=.true., &
start_cycle=.false., end_cycle=(n==n_max), cycle_length=dt_forcing)
Expand All @@ -541,25 +542,25 @@ program MOM_main
endif

t_elapsed_seg = t_elapsed_seg + dt_dyn
Time2 = Time1 + set_time(int(floor(t_elapsed_seg + 0.5)))
Time2 = Time1 + real_to_time(t_elapsed_seg)
enddo
endif

! Time = Time + Time_step_ocean
! This is here to enable fractional-second time steps.
elapsed_time = elapsed_time + dt_forcing
if (elapsed_time > 2e9) then
! This is here to ensure that the conversion from a real to an integer
! can be accurately represented in long runs (longer than ~63 years).
! It will also ensure that elapsed time does not lose resolution of order
! the timetype's resolution, provided that the timestep and tick are
! larger than 10-5 seconds. If a clock with a finer resolution is used,
! a smaller value would be required.
segment_start_time = segment_start_time + set_time(int(floor(elapsed_time)))
elapsed_time = elapsed_time - floor(elapsed_time)
! This is here to ensure that the conversion from a real to an integer can be accurately
! represented in long runs (longer than ~63 years). It will also ensure that elapsed time
! does not lose resolution of order the timetype's resolution, provided that the timestep and
! tick are larger than 10-5 seconds. If a clock with a finer resolution is used, a smaller
! value would be required.
time_chg = real_to_time(elapsed_time)
segment_start_time = segment_start_time + time_chg
elapsed_time = elapsed_time - time_type_to_real(time_chg)
endif
if (elapsed_time_master) then
Master_Time = segment_start_time + set_time(int(floor(elapsed_time+0.5)))
Master_Time = segment_start_time + real_to_time(elapsed_time)
else
Master_Time = Master_Time + Time_step_ocean
endif
Expand All @@ -570,8 +571,7 @@ program MOM_main
endif ; endif

call enable_averaging(dt_forcing, Time, diag)
call mech_forcing_diags(forces, fluxes, dt_forcing, grid, diag, &
surface_forcing_CSp%handles)
call mech_forcing_diags(forces, dt_forcing, grid, diag, surface_forcing_CSp%handles)
call disable_averaging(diag)

if (.not. offline_tracer_mode) then
Expand Down
Loading