From 671aa5f99457a40df44a4cece0747e732f0f9afc Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Wed, 29 Jun 2016 10:08:24 -0400 Subject: [PATCH 1/2] Reordered domain and grid inits & parameter reads Moved MOM domain and grid initialization after the parameters are read in MOM.F90. This will facilitate setting parameters at an appropriate higher level for sharing with the code that sets up the grid. All answers are bitwise identical, but the order of entries in the MOM_parameter_doc files have changed. --- src/core/MOM.F90 | 62 +++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index f888599b6e..97a319be90 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -1423,36 +1423,6 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) call find_obsolete_params(param_file) -#ifdef SYMMETRIC_MEMORY_ - symmetric = .true. -#else - symmetric = .false. -#endif -#ifdef STATIC_MEMORY_ - call MOM_domains_init(G%domain, param_file, symmetric=symmetric, & - static_memory=.true., NIHALO=NIHALO_, NJHALO=NJHALO_, & - NIGLOBAL=NIGLOBAL_, NJGLOBAL=NJGLOBAL_, NIPROC=NIPROC_, & - NJPROC=NJPROC_) -#else - call MOM_domains_init(G%domain, param_file, symmetric=symmetric) -#endif - call callTree_waypoint("domains initialized (initialize_MOM)") - - call MOM_checksums_init(param_file) - - call diag_mediator_infrastructure_init() - call MOM_io_init(param_file) - call MOM_grid_init(G, param_file) - - call create_dyn_horgrid(dG, G%HI) - dG%first_direction = G%first_direction - dG%bathymetry_at_vel = G%bathymetry_at_vel - call clone_MOM_domain(G%Domain, dG%Domain) - - call verticalGridInit( param_file, CS%GV ) - GV => CS%GV - dG%g_Earth = GV%g_Earth - ! Read relevant parameters and write them to the model log. call log_version(param_file, "MOM", version, "") call get_param(param_file, "MOM", "VERBOSITY", verbosity, & @@ -1662,6 +1632,38 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) if (CS%adiabatic .and. CS%bulkmixedlayer) call MOM_error(FATAL, & "MOM: ADIABATIC and BULKMIXEDLAYER can not both be defined.") + ! Set up the model domain and grids. +#ifdef SYMMETRIC_MEMORY_ + symmetric = .true. +#else + symmetric = .false. +#endif +#ifdef STATIC_MEMORY_ + call MOM_domains_init(G%domain, param_file, symmetric=symmetric, & + static_memory=.true., NIHALO=NIHALO_, NJHALO=NJHALO_, & + NIGLOBAL=NIGLOBAL_, NJGLOBAL=NJGLOBAL_, NIPROC=NIPROC_, & + NJPROC=NJPROC_) +#else + call MOM_domains_init(G%domain, param_file, symmetric=symmetric) +#endif + call callTree_waypoint("domains initialized (initialize_MOM)") + + call MOM_checksums_init(param_file) + + call diag_mediator_infrastructure_init() + call MOM_io_init(param_file) + call MOM_grid_init(G, param_file) + + call create_dyn_horgrid(dG, G%HI) + dG%first_direction = G%first_direction + dG%bathymetry_at_vel = G%bathymetry_at_vel + call clone_MOM_domain(G%Domain, dG%Domain) + + call verticalGridInit( param_file, CS%GV ) + GV => CS%GV + dG%g_Earth = GV%g_Earth + + ! Allocate the auxiliary non-symmetric domain for debugging or I/O purposes. if (CS%debug .or. dG%symmetric) & call clone_MOM_domain(dG%Domain, dG%Domain_aux, symmetric=.false.) From 3e80bcb94a47c7be86e5c18550b3e2a9fe101338 Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Wed, 29 Jun 2016 15:02:56 -0400 Subject: [PATCH 2/2] +Use GV%g_Earth in place of G%g_Earth Replaced G%g_Earth with GV%g_Earth whereever possible, and read G_EARTH only from the vertical grid module. Also reordered the reading of BULKMIXEDLAYER and USE_REGRIDDING, and changed the default value of BULKMIXEDLAYER to false when USE_REGRIDDING is true. (Default settings should not lead to fatal errors!) All answers are bitwise identical in configurations that would actually work, although one default value sometimes changes and most MOM_parameter_doc files are changed. --- src/core/MOM.F90 | 57 ++++++++++--------- src/core/MOM_PressureForce_Montgomery.F90 | 14 ++--- src/core/MOM_PressureForce_analytic_FV.F90 | 26 ++++----- src/core/MOM_dynamics_legacy_split.F90 | 2 +- src/core/MOM_forcing_type.F90 | 2 +- src/core/MOM_grid.F90 | 47 ++++++++++----- src/core/MOM_isopycnal_slopes.F90 | 2 +- src/diagnostics/MOM_diagnostics.F90 | 16 +++--- src/diagnostics/MOM_sum_output.F90 | 4 +- src/diagnostics/MOM_wave_speed.F90 | 8 +-- src/diagnostics/MOM_wave_structure.F90 | 4 +- .../MOM_state_initialization.F90 | 18 +++--- .../lateral/MOM_lateral_mixing_coeffs.F90 | 2 +- .../lateral/MOM_mixed_layer_restrat.F90 | 4 +- .../lateral/MOM_thickness_diffuse.F90 | 4 +- src/parameterizations/vertical/MOM_KPP.F90 | 2 +- .../vertical/MOM_bulk_mixed_layer.F90 | 16 +++--- .../vertical/MOM_diabatic_aux.F90 | 16 +++--- .../vertical/MOM_diapyc_energy_req.F90 | 4 +- .../vertical/MOM_diffConvection.F90 | 4 +- .../vertical/MOM_energetic_PBL.F90 | 2 +- .../vertical/MOM_entrain_diffusive.F90 | 2 +- .../vertical/MOM_internal_tide_input.F90 | 2 +- .../vertical/MOM_kappa_shear.F90 | 2 +- .../vertical/MOM_set_diffusivity.F90 | 12 ++-- .../vertical/MOM_set_viscosity.F90 | 6 +- .../vertical/MOM_shortwave_abs.F90 | 2 +- src/user/DOME_initialization.F90 | 2 +- src/user/Rossby_front_2d_initialization.F90 | 2 +- 29 files changed, 153 insertions(+), 131 deletions(-) diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index 97a319be90..4f4dc68bd3 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -690,7 +690,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) if (CS%id_T_preale > 0) call post_data(CS%id_T_preale, CS%tv%T, CS%diag) if (CS%id_S_preale > 0) call post_data(CS%id_S_preale, CS%tv%S, CS%diag) if (CS%id_e_preale > 0) then - call find_eta(h, CS%tv, G%g_Earth, G, GV, eta_preale) + call find_eta(h, CS%tv, GV%g_Earth, G, GV, eta_preale) call post_data(CS%id_e_preale, eta_preale, CS%diag) endif @@ -984,7 +984,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) if (CS%id_T_predia > 0) call post_data(CS%id_T_predia, CS%tv%T, CS%diag) if (CS%id_S_predia > 0) call post_data(CS%id_S_predia, CS%tv%S, CS%diag) if (CS%id_e_predia > 0) then - call find_eta(h, CS%tv, G%g_Earth, G, GV, eta_predia) + call find_eta(h, CS%tv, GV%g_Earth, G, GV, eta_predia) call post_data(CS%id_e_predia, eta_predia, CS%diag) endif @@ -1184,7 +1184,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) ! diagnosed ssh for non-Bouss; call "find_eta" for this ! purpose. tot_wt_ssh = tot_wt_ssh + dt - call find_eta(h, CS%tv, G%g_Earth, G, GV, ssh, eta_av) + call find_eta(h, CS%tv, GV%g_Earth, G, GV, ssh, eta_av) do j=js,je ; do i=is,ie CS%ave_ssh(i,j) = CS%ave_ssh(i,j) + dt*ssh(i,j) enddo ; enddo @@ -1227,7 +1227,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) enddo ; enddo if (ASSOCIATED(fluxes%p_surf)) then do j=js,je ; do i=is,ie - zos(i,j) = zos(i,j)+G%mask2dT(i,j)*fluxes%p_surf(i,j)/(GV%Rho0 * G%g_Earth) + zos(i,j) = zos(i,j)+G%mask2dT(i,j)*fluxes%p_surf(i,j)/(GV%Rho0 * GV%g_Earth) enddo ; enddo endif zos_area_mean = global_area_mean(zos, G) @@ -1444,6 +1444,7 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) default=.false.) CS%legacy_split = .false. endif + call get_param(param_file, "MOM", "ENABLE_THERMODYNAMICS", CS%use_temperature, & "If true, Temperature and salinity are used as state \n"//& "variables.", default=.true.) @@ -1461,27 +1462,22 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) "true. This assumes that KD = KDML = 0.0 and that \n"//& "there is no buoyancy forcing, but makes the model \n"//& "faster by eliminating subroutine calls.", default=.false.) + call get_param(param_file, "MOM", "DO_DYNAMICS", CS%do_dynamics, & + "If False, skips the dynamics calls that update u & v, as well as\n"//& + "the gravity wave adjustment to h. This is a fragile feature and\n"//& + "thus undocumented.", default=.true., do_not_log=.true. ) + + call get_param(param_file, "MOM", "USE_REGRIDDING", CS%use_ALE_algorithm , & + "If True, use the ALE algorithm (regridding/remapping).\n"//& + "If False, use the layered isopycnal algorithm.", default=.false. ) call get_param(param_file, "MOM", "BULKMIXEDLAYER", CS%bulkmixedlayer, & "If true, use a Kraus-Turner-like bulk mixed layer \n"//& "with transitional buffer layers. Layers 1 through \n"//& "NKML+NKBL have variable densities. There must be at \n"//& "least NKML+NKBL+1 layers if BULKMIXEDLAYER is true. \n"//& - "The default is the same setting as ENABLE_THERMODYNAMICS.", & - default=CS%use_temperature) - call get_param(param_file, "MOM", "USE_REGRIDDING", & - CS%use_ALE_algorithm , & - "If True, use the ALE algorithm (regridding/remapping).\n"//& - "If False, use the layered isopycnal algorithm.", default=.false. ) - if (CS%use_ALE_algorithm) then - if (CS%bulkmixedlayer) call MOM_error(FATAL, & - "MOM: BULKMIXEDLAYER can not currently be used with the ALE algorithm.") - if (.not. CS%use_temperature) call MOM_error(FATAL, & - "MOM: At this time, USE_EOS should be True when using the ALE algorithm.") - endif - call get_param(param_file, "MOM", "DO_DYNAMICS", CS%do_dynamics, & - "If False, skips the dynamics calls that update u & v, as well as\n"//& - "the gravity wave adjustment to h. This is a fragile feature and\n"//& - "thus undocumented.", default=.true., do_not_log=.true. ) + "BULKMIXEDLAYER can not be used with USE_REGRIDDING. \n"//& + "The default is influenced by ENABLE_THERMODYNAMICS.", & + default=CS%use_temperature .and. .not.CS%use_ALE_algorithm) call get_param(param_file, "MOM", "THICKNESSDIFFUSE", CS%thickness_diffuse, & "If true, interface heights are diffused with a \n"//& "coefficient of KHTH.", default=.false.) @@ -1624,7 +1620,11 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) write_geom_files = ((write_geom==2) .or. ((write_geom==1) .and. & ((dirs%input_filename(1:1)=='n') .and. (LEN_TRIM(dirs%input_filename)==1)))) - ! Check for inconsistent settings. + ! Check for inconsistent parameter settings. + if (CS%use_ALE_algorithm .and. CS%bulkmixedlayer) call MOM_error(FATAL, & + "MOM: BULKMIXEDLAYER can not currently be used with the ALE algorithm.") + if (CS%use_ALE_algorithm .and. .not.CS%use_temperature) call MOM_error(FATAL, & + "MOM: At this time, USE_EOS should be True when using the ALE algorithm.") if (CS%adiabatic .and. CS%use_temperature) call MOM_error(WARNING, & "MOM: ADIABATIC and ENABLE_THERMODYNAMICS both defined is usually unwise.") if (use_EOS .and. .not.CS%use_temperature) call MOM_error(FATAL, & @@ -1632,6 +1632,8 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) if (CS%adiabatic .and. CS%bulkmixedlayer) call MOM_error(FATAL, & "MOM: ADIABATIC and BULKMIXEDLAYER can not both be defined.") + call callTree_waypoint("MOM parameters read (initialize_MOM)") + ! Set up the model domain and grids. #ifdef SYMMETRIC_MEMORY_ symmetric = .true. @@ -1661,13 +1663,16 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) call verticalGridInit( param_file, CS%GV ) GV => CS%GV - dG%g_Earth = GV%g_Earth + dG%g_Earth = GV%g_Earth ; G%g_Earth = GV%g_Earth ! Allocate the auxiliary non-symmetric domain for debugging or I/O purposes. if (CS%debug .or. dG%symmetric) & call clone_MOM_domain(dG%Domain, dG%Domain_aux, symmetric=.false.) + call callTree_waypoint("grids initialized (initialize_MOM)") + + call MOM_timing_init(CS) call tracer_registry_init(param_file, CS%tracer_Reg) @@ -2051,9 +2056,9 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) if (.not.query_initialized(CS%ave_ssh,"ave_ssh",CS%restart_CSp)) then if (CS%split) then - call find_eta(CS%h, CS%tv, G%g_Earth, G, GV, CS%ave_ssh, eta) + call find_eta(CS%h, CS%tv, GV%g_Earth, G, GV, CS%ave_ssh, eta) else - call find_eta(CS%h, CS%tv, G%g_Earth, G, GV, CS%ave_ssh) + call find_eta(CS%h, CS%tv, GV%g_Earth, G, GV, CS%ave_ssh) endif endif if (CS%split) deallocate(eta) @@ -2098,7 +2103,7 @@ subroutine finish_MOM_initialization(Time, dirs, CS, fluxes) allocate(restart_CSp_tmp) restart_CSp_tmp = CS%restart_CSp allocate(z_interface(SZI_(G),SZJ_(G),SZK_(G)+1)) - call find_eta(CS%h, CS%tv, G%g_Earth, G, GV, z_interface) + call find_eta(CS%h, CS%tv, GV%g_Earth, G, GV, z_interface) vd = var_desc("eta","meter","Interface heights",z_grid='i') call register_restart_field(z_interface, vd, .true., restart_CSp_tmp) @@ -2843,7 +2848,7 @@ subroutine calculate_surface_state(state, u, v, h, ssh, G, GV, CS, p_atm) state%sea_lev => ssh if (present(p_atm)) then ; if (ASSOCIATED(p_atm)) then - IgR0 = 1.0 / (GV%Rho0 * G%g_Earth) + IgR0 = 1.0 / (GV%Rho0 * GV%g_Earth) do j=js,je ; do i=is,ie ssh(i,j) = ssh(i,j) + p_atm(i,j) * IgR0 enddo ; enddo diff --git a/src/core/MOM_PressureForce_Montgomery.F90 b/src/core/MOM_PressureForce_Montgomery.F90 index eea083f9ab..c0418aeb0a 100644 --- a/src/core/MOM_PressureForce_Montgomery.F90 +++ b/src/core/MOM_PressureForce_Montgomery.F90 @@ -195,7 +195,7 @@ subroutine PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, "can no longer be used with a compressible EOS. Use #define ANALYTIC_FV_PGF.") endif - I_gEarth = 1.0 / G%g_Earth + I_gEarth = 1.0 / GV%g_Earth dp_neglect = GV%H_to_Pa * GV%H_subroundoff !$OMP parallel default(none) shared(nz,alpha_Lay,GV,dalpha_int) !$OMP do @@ -263,12 +263,12 @@ subroutine PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, call calc_tidal_forcing(CS%Time, SSH, e_tidal, G, CS%tides_CSp) !$OMP parallel do default(none) shared(Isq,Ieq,Jsq,Jeq,geopot_bot,G,e_tidal) do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1 - geopot_bot(i,j) = -G%g_Earth*(e_tidal(i,j) + G%bathyT(i,j)) + geopot_bot(i,j) = -GV%g_Earth*(e_tidal(i,j) + G%bathyT(i,j)) enddo ; enddo else !$OMP parallel do default(none) shared(Isq,Ieq,Jsq,Jeq,geopot_bot,G) do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1 - geopot_bot(i,j) = -G%g_Earth*G%bathyT(i,j) + geopot_bot(i,j) = -GV%g_Earth*G%bathyT(i,j) enddo ; enddo endif @@ -366,7 +366,7 @@ subroutine PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, ! Note that ddM/dPb = alpha_star(i,j,1) if (present(pbce)) then - call Set_pbce_nonBouss(p, tv_tmp, G, GV, G%g_Earth, CS%GFS_scale, pbce, & + call Set_pbce_nonBouss(p, tv_tmp, G, GV, GV%g_Earth, CS%GFS_scale, pbce, & alpha_star) endif @@ -510,7 +510,7 @@ subroutine PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, eta h_neglect = GV%H_subroundoff * GV%H_to_m I_Rho0 = 1.0/CS%Rho0 - G_Rho0 = G%g_Earth/GV%Rho0 + G_Rho0 = GV%g_Earth/GV%Rho0 if (CS%tides) then ! Determine the surface height anomaly for calculating self attraction @@ -619,7 +619,7 @@ subroutine PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, eta endif ! use_EOS if (present(pbce)) then - call Set_pbce_Bouss(e, tv_tmp, G, GV, G%g_Earth, CS%Rho0, CS%GFS_scale, pbce, & + call Set_pbce_Bouss(e, tv_tmp, G, GV, GV%g_Earth, CS%Rho0, CS%GFS_scale, pbce, & rho_star) endif @@ -1000,7 +1000,7 @@ subroutine PressureForce_Mont_init(Time, G, GV, param_file, diag, CS, tides_CSp) endif CS%GFS_scale = 1.0 - if (GV%g_prime(1) /= G%g_Earth) CS%GFS_scale = GV%g_prime(1) / G%g_Earth + if (GV%g_prime(1) /= GV%g_Earth) CS%GFS_scale = GV%g_prime(1) / GV%g_Earth call log_param(param_file, mod, "GFS / G_EARTH", CS%GFS_scale) diff --git a/src/core/MOM_PressureForce_analytic_FV.F90 b/src/core/MOM_PressureForce_analytic_FV.F90 index 2d92fa6a3f..21aabfabbc 100644 --- a/src/core/MOM_PressureForce_analytic_FV.F90 +++ b/src/core/MOM_PressureForce_analytic_FV.F90 @@ -252,7 +252,7 @@ subroutine PressureForce_AFV_nonBouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, e enddo ; enddo ; enddo !$OMP end parallel - I_gEarth = 1.0 / G%g_Earth + I_gEarth = 1.0 / GV%g_Earth if (use_EOS) then ! With a bulk mixed layer, replace the T & S of any layers that are @@ -323,7 +323,7 @@ subroutine PressureForce_AFV_nonBouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, e !$OMP parallel do default(none) shared(Isq,Ieq,Jsq,Jeq,nz,za,alpha_ref,p,G,dza) do j=Jsq,Jeq+1 do i=Isq,Ieq+1 - za(i,j) = alpha_ref*p(i,j,nz+1) - G%g_Earth*G%bathyT(i,j) + za(i,j) = alpha_ref*p(i,j,nz+1) - GV%g_Earth*G%bathyT(i,j) enddo do k=nz,1,-1 ; do i=Isq,Ieq+1 za(i,j) = za(i,j) + dza(i,j,k) @@ -339,7 +339,7 @@ subroutine PressureForce_AFV_nonBouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, e call calc_tidal_forcing(CS%Time, SSH, e_tidal, G, CS%tides_CSp) !$OMP parallel do default(none) shared(Isq,Ieq,Jsq,Jeq,za,G,e_tidal) do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1 - za(i,j) = za(i,j) - G%g_Earth*e_tidal(i,j) + za(i,j) = za(i,j) - GV%g_Earth*e_tidal(i,j) enddo ; enddo endif @@ -439,7 +439,7 @@ subroutine PressureForce_AFV_nonBouss(h, tv, PFu, PFv, G, GV, CS, p_atm, pbce, e enddo if (present(pbce)) then - call set_pbce_nonBouss(p, tv_tmp, G, GV, G%g_Earth, CS%GFS_scale, pbce) + call set_pbce_nonBouss(p, tv_tmp, G, GV, GV%g_Earth, CS%GFS_scale, pbce) endif if (present(eta)) then @@ -574,7 +574,7 @@ subroutine PressureForce_AFV_Bouss(h, tv, PFu, PFv, G, GV, CS, ALE_CSp, p_atm, p PRScheme = pressureReconstructionScheme(ALE_CSp) h_neglect = GV%H_subroundoff I_Rho0 = 1.0/GV%Rho0 - G_Rho0 = G%g_Earth/GV%Rho0 + G_Rho0 = GV%g_Earth/GV%Rho0 rho_ref = CS%Rho0 if (CS%tides) then @@ -711,12 +711,12 @@ subroutine PressureForce_AFV_Bouss(h, tv, PFu, PFv, G, GV, CS, ALE_CSp, p_atm, p if (use_p_atm) then do jb=Jsq_bk,Jeq_bk+1 ; do ib=Isq_bk,Ieq_bk+1 i = ib+ioff_bk ; j = jb+joff_bk - pa_bk(ib,jb) = (rho_ref*G%g_Earth)*e(i,j,1) + p_atm(i,j) + pa_bk(ib,jb) = (rho_ref*GV%g_Earth)*e(i,j,1) + p_atm(i,j) enddo ; enddo else do jb=Jsq_bk,Jeq_bk+1 ; do ib=Isq_bk,Ieq_bk+1 i = ib+ioff_bk ; j = jb+joff_bk - pa_bk(ib,jb) = (rho_ref*G%g_Earth)*e(i,j,1) + pa_bk(ib,jb) = (rho_ref*GV%g_Earth)*e(i,j,1) enddo ; enddo endif do jb=js_bk,je_bk ; do Ib=Isq_bk,Ieq_bk @@ -740,28 +740,28 @@ subroutine PressureForce_AFV_Bouss(h, tv, PFu, PFv, G, GV, CS, ALE_CSp, p_atm, p if ( PRScheme == PRESSURE_RECONSTRUCTION_PLM ) then call int_density_dz_generic_plm ( T_t(:,:,k), T_b(:,:,k), & S_t(:,:,k), S_b(:,:,k), e(:,:,K), e(:,:,K+1), & - rho_ref, CS%Rho0, G%g_Earth, & + rho_ref, CS%Rho0, GV%g_Earth, & GV%H_subroundoff, G%bathyT, G%HI, G%Block(n), & tv%eqn_of_state, dpa_bk, intz_dpa_bk, intx_dpa_bk, inty_dpa_bk, & useMassWghtInterp = CS%useMassWghtInterp) elseif ( PRScheme == PRESSURE_RECONSTRUCTION_PPM ) then call int_density_dz_generic_ppm ( tv%T(:,:,k), T_t(:,:,k), T_b(:,:,k), & tv%S(:,:,k), S_t(:,:,k), S_b(:,:,k), e(:,:,K), e(:,:,K+1), & - rho_ref, CS%Rho0, G%G_Earth, & + rho_ref, CS%Rho0, GV%g_Earth, & G%HI, G%Block(n), tv%eqn_of_state, dpa_bk, intz_dpa_bk, & intx_dpa_bk, inty_dpa_bk) endif else call int_density_dz(tv_tmp%T(:,:,k), tv_tmp%S(:,:,k), & e(:,:,K), e(:,:,K+1), & - rho_ref, CS%Rho0, G%g_Earth, G%HI, G%Block(n), tv%eqn_of_state, & + rho_ref, CS%Rho0, GV%g_Earth, G%HI, G%Block(n), tv%eqn_of_state, & dpa_bk, intz_dpa_bk, intx_dpa_bk, inty_dpa_bk ) endif intz_dpa_bk(:,:) = intz_dpa_bk(:,:)*GV%m_to_H else do jb=Jsq_bk,Jeq_bk+1 ; do ib=Isq_bk,Ieq_bk+1 i = ib+ioff_bk ; j = jb+joff_bk - dz_bk(ib,jb) = G%g_Earth*GV%H_to_m*h(i,j,k) + dz_bk(ib,jb) = GV%g_Earth*GV%H_to_m*h(i,j,k) dpa_bk(ib,jb) = (GV%Rlay(k) - rho_ref)*dz_bk(ib,jb) intz_dpa_bk(ib,jb) = 0.5*(GV%Rlay(k) - rho_ref)*dz_bk(ib,jb)*h(i,j,k) enddo ; enddo @@ -813,7 +813,7 @@ subroutine PressureForce_AFV_Bouss(h, tv, PFu, PFv, G, GV, CS, ALE_CSp, p_atm, p enddo if (present(pbce)) then - call set_pbce_Bouss(e, tv_tmp, G, GV, G%g_Earth, CS%Rho0, CS%GFS_scale, pbce) + call set_pbce_Bouss(e, tv_tmp, G, GV, GV%g_Earth, CS%Rho0, CS%GFS_scale, pbce) endif if (present(eta)) then @@ -890,7 +890,7 @@ subroutine PressureForce_AFV_init(Time, G, GV, param_file, diag, CS, tides_CSp) endif CS%GFS_scale = 1.0 - if (GV%g_prime(1) /= G%g_Earth) CS%GFS_scale = GV%g_prime(1) / G%g_Earth + if (GV%g_prime(1) /= GV%g_Earth) CS%GFS_scale = GV%g_prime(1) / GV%g_Earth call log_param(param_file, mod, "GFS / G_EARTH", CS%GFS_scale) diff --git a/src/core/MOM_dynamics_legacy_split.F90 b/src/core/MOM_dynamics_legacy_split.F90 index 8fe4508b24..afb455a2a9 100644 --- a/src/core/MOM_dynamics_legacy_split.F90 +++ b/src/core/MOM_dynamics_legacy_split.F90 @@ -475,7 +475,7 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, & CS%ALE_CSp, p_surf, CS%pbce, CS%eta_PF) if (dyn_p_surf) then if (GV%Boussinesq) then - Pa_to_eta = 1.0 / (GV%Rho0*G%g_Earth) + Pa_to_eta = 1.0 / (GV%Rho0*GV%g_Earth) else Pa_to_eta = 1.0 / GV%H_to_Pa endif diff --git a/src/core/MOM_forcing_type.F90 b/src/core/MOM_forcing_type.F90 index e2f9998b6a..9883d63c03 100644 --- a/src/core/MOM_forcing_type.F90 +++ b/src/core/MOM_forcing_type.F90 @@ -696,7 +696,7 @@ subroutine calculateBuoyancyFlux1d(G, GV, fluxes, optics, h, Temp, Salt, tv, j, depthBeforeScalingFluxes = max( GV%Angstrom, 1.e-30*GV%m_to_H ) pressure(:) = 0. ! Ignore atmospheric pressure - GoRho = G%g_Earth / GV%Rho0 + GoRho = GV%g_Earth / GV%Rho0 start = 1 + G%isc - G%isd npts = 1 + G%iec - G%isc diff --git a/src/core/MOM_grid.F90 b/src/core/MOM_grid.F90 index fd8f252eb4..de44bd8f7f 100644 --- a/src/core/MOM_grid.F90 +++ b/src/core/MOM_grid.F90 @@ -151,9 +151,10 @@ module MOM_grid !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! !> MOM_grid_init initializes the ocean grid array sizes and grid memory. -subroutine MOM_grid_init(G, param_file) +subroutine MOM_grid_init(G, param_file, HI) type(ocean_grid_type), intent(inout) :: G !< The horizontal grid type type(param_file_type), intent(in) :: param_file !< Parameter file handle + type(hor_index_type), optional, intent(in) :: HI !< A hor_index_type for array extents ! Arguments: G - The ocean's grid structure. ! (in) param_file - A structure indicating the open file to parse for ! model parameter values. @@ -173,9 +174,9 @@ subroutine MOM_grid_init(G, param_file) ! Read all relevant parameters and write them to the model log. call log_version(param_file, mod_nm, version, & "Parameters providing information about the lateral grid.") - call get_param(param_file, "MOM", "G_EARTH", G%g_Earth, & - "The gravitational acceleration of the Earth.", & - units="m s-2", default = 9.80) +! call get_param(param_file, "MOM", "G_EARTH", G%g_Earth, & +! "The gravitational acceleration of the Earth.", & +! units="m s-2", default = 9.80) call get_param(param_file, mod_nm, "GLOBAL_INDEXING", global_indexing, & "If true, use a global lateral indexing convention, so \n"//& "that corresponding points on different processors have \n"//& @@ -204,17 +205,33 @@ subroutine MOM_grid_init(G, param_file) "in the y-direction on each processor (for openmp).", default=1, & layoutParam=.true.) - call hor_index_init(G%Domain, G%HI, param_file, & - local_indexing=.not.global_indexing) - - ! get_domain_extent ensures that domains start at 1 for compatibility between - ! static and dynamically allocated arrays, unless global_indexing is true. - call get_domain_extent(G%Domain, G%isc, G%iec, G%jsc, G%jec, & - G%isd, G%ied, G%jsd, G%jed, & - G%isg, G%ieg, G%jsg, G%jeg, & - G%idg_offset, G%jdg_offset, G%symmetric, & - local_indexing=.not.global_indexing) - G%isd_global = G%isd+G%idg_offset ; G%jsd_global = G%jsd+G%jdg_offset + if (present(HI)) then + G%HI = HI + + G%isc = HI%isc ; G%iec = HI%iec ; G%jsc = HI%jsc ; G%jec = HI%jec + G%isd = HI%isd ; G%ied = HI%ied ; G%jsd = HI%jsd ; G%jed = HI%jed + G%isg = HI%isg ; G%ieg = HI%ieg ; G%jsg = HI%jsg ; G%jeg = HI%jeg + + G%IscB = HI%IscB ; G%IecB = HI%IecB ; G%JscB = HI%JscB ; G%JecB = HI%JecB + G%IsdB = HI%IsdB ; G%IedB = HI%IedB ; G%JsdB = HI%JsdB ; G%JedB = HI%JedB + G%IsgB = HI%IsgB ; G%IegB = HI%IegB ; G%JsgB = HI%JsgB ; G%JegB = HI%JegB + + G%idg_offset = HI%idg_offset ; G%jdg_offset = HI%jdg_offset + G%isd_global = G%isd + HI%idg_offset ; G%jsd_global = G%jsd + HI%jdg_offset + G%symmetric = HI%symmetric + else + call hor_index_init(G%Domain, G%HI, param_file, & + local_indexing=.not.global_indexing) + + ! get_domain_extent ensures that domains start at 1 for compatibility between + ! static and dynamically allocated arrays, unless global_indexing is true. + call get_domain_extent(G%Domain, G%isc, G%iec, G%jsc, G%jec, & + G%isd, G%ied, G%jsd, G%jed, & + G%isg, G%ieg, G%jsg, G%jeg, & + G%idg_offset, G%jdg_offset, G%symmetric, & + local_indexing=.not.global_indexing) + G%isd_global = G%isd+G%idg_offset ; G%jsd_global = G%jsd+G%jdg_offset + endif G%nonblocking_updates = G%Domain%nonblocking_updates diff --git a/src/core/MOM_isopycnal_slopes.F90 b/src/core/MOM_isopycnal_slopes.F90 index c5432934b6..6e12fa1bd4 100644 --- a/src/core/MOM_isopycnal_slopes.F90 +++ b/src/core/MOM_isopycnal_slopes.F90 @@ -94,7 +94,7 @@ subroutine calc_isoneutral_slopes(G, GV, h, e, tv, dt_kappa_smooth, & present_N2_u = PRESENT(N2_u) present_N2_v = PRESENT(N2_v) - G_Rho0 = G%g_Earth / GV%Rho0 + G_Rho0 = GV%g_Earth / GV%Rho0 if (present_N2_u) then do j=js,je ; do I=is-1,ie N2_u(I,j,1) = 0. diff --git a/src/diagnostics/MOM_diagnostics.F90 b/src/diagnostics/MOM_diagnostics.F90 index 86e6812969..9667ba03cf 100644 --- a/src/diagnostics/MOM_diagnostics.F90 +++ b/src/diagnostics/MOM_diagnostics.F90 @@ -243,7 +243,7 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, fluxes, & call calculate_derivs(dt, G, CS) if (ASSOCIATED(CS%e)) then - call find_eta(h, tv, G%g_Earth, G, GV, CS%e, eta_bt) + call find_eta(h, tv, GV%g_Earth, G, GV, CS%e, eta_bt) if (CS%id_e > 0) call post_data(CS%id_e, CS%e, CS%diag) endif @@ -253,7 +253,7 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, fluxes, & CS%e_D(i,j,k) = CS%e(i,j,k) + G%bathyT(i,j) enddo ; enddo ; enddo else - call find_eta(h, tv, G%g_Earth, G, GV, CS%e_D, eta_bt) + call find_eta(h, tv, GV%g_Earth, G, GV, CS%e_D, eta_bt) do k=1,nz+1 ; do j=js,je ; do i=is,ie CS%e_D(i,j,k) = CS%e_D(i,j,k) + G%bathyT(i,j) enddo ; enddo ; enddo @@ -304,7 +304,7 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, fluxes, & do k=1,nz ! pressure for EOS at the layer center (Pa) do i=is,ie - pressure_1d(i) = pressure_1d(i) + 0.5*(G%G_Earth*GV%H_to_kg_m2)*h(i,j,k) + pressure_1d(i) = pressure_1d(i) + 0.5*(GV%g_Earth*GV%H_to_kg_m2)*h(i,j,k) enddo ! store in-situ density (kg/m3) in diag_tmp3d call calculate_density(tv%T(:,j,k),tv%S(:,j,k), pressure_1d, & @@ -315,7 +315,7 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, fluxes, & enddo ! pressure for EOS at the bottom interface (Pa) do i=is,ie - pressure_1d(i) = pressure_1d(i) + 0.5*(G%G_Earth*GV%H_to_kg_m2)*h(i,j,k) + pressure_1d(i) = pressure_1d(i) + 0.5*(GV%g_Earth*GV%H_to_kg_m2)*h(i,j,k) enddo enddo ! k @@ -707,7 +707,7 @@ subroutine calculate_vertical_integrals(h, tv, fluxes, G, GV, CS) endif if (CS%id_col_ht > 0) then - call find_eta(h, tv, G%g_Earth, G, GV, z_top) + call find_eta(h, tv, GV%g_Earth, G, GV, z_top) do j=js,je ; do i=is,ie z_bot(i,j) = z_top(i,j) + G%bathyT(i,j) enddo ; enddo @@ -718,7 +718,7 @@ subroutine calculate_vertical_integrals(h, tv, fluxes, G, GV, CS) do j=js,je ; do i=is,ie ; mass(i,j) = 0.0 ; enddo ; enddo if (GV%Boussinesq) then if (associated(tv%eqn_of_state)) then - IG_Earth = 1.0 / G%g_Earth + IG_Earth = 1.0 / GV%g_Earth ! do j=js,je ; do i=is,ie ; z_bot(i,j) = -P_SURF(i,j)/GV%H_to_Pa ; enddo ; enddo do j=js,je ; do i=is,ie ; z_bot(i,j) = 0.0 ; enddo ; enddo do k=1,nz @@ -727,7 +727,7 @@ subroutine calculate_vertical_integrals(h, tv, fluxes, G, GV, CS) z_bot(i,j) = z_top(i,j) - GV%H_to_m*h(i,j,k) enddo ; enddo call int_density_dz(tv%T(:,:,k), tv%S(:,:,k), & - z_top, z_bot, 0.0, GV%H_to_kg_m2, G%g_Earth, & + z_top, z_bot, 0.0, GV%H_to_kg_m2, GV%g_Earth, & G%HI, G%HI, tv%eqn_of_state, dpress) do j=js,je ; do i=is,ie mass(i,j) = mass(i,j) + dpress(i,j) * IG_Earth @@ -753,7 +753,7 @@ subroutine calculate_vertical_integrals(h, tv, fluxes, G, GV, CS) ! where pso is the sea water pressure at sea water surface ! note that pso is equivalent to fluxes%p_surf do j=js,je ; do i=is,ie - btm_pres(i,j) = mass(i,j) * G%g_Earth + btm_pres(i,j) = mass(i,j) * GV%g_Earth if (ASSOCIATED(fluxes%p_surf)) then btm_pres(i,j) = btm_pres(i,j) + fluxes%p_surf(i,j) endif diff --git a/src/diagnostics/MOM_sum_output.F90 b/src/diagnostics/MOM_sum_output.F90 index d0aa3cd65c..da6c0f5b63 100644 --- a/src/diagnostics/MOM_sum_output.F90 +++ b/src/diagnostics/MOM_sum_output.F90 @@ -474,7 +474,7 @@ subroutine write_energy(u, v, h, tv, day, n, G, GV, CS, tracer_CSp) enddo ; enddo ; enddo mass_tot = reproducing_sum(tmp1, sums=mass_lay, EFP_sum=mass_EFP) - call find_eta(h, tv, G%g_Earth, G, GV, eta) + call find_eta(h, tv, GV%g_Earth, G, GV, eta) do k=1,nz ; do j=js,je ; do i=is,ie tmp1(i,j,k) = (eta(i,j,K)-eta(i,j,K+1)) * areaTm(i,j) enddo ; enddo ; enddo @@ -494,7 +494,7 @@ subroutine write_energy(u, v, h, tv, day, n, G, GV, CS, tracer_CSp) enddo ; enddo enddo if (CS%do_APE_calc) then - call find_eta(h, tv, G%g_Earth, G, GV, eta) + call find_eta(h, tv, GV%g_Earth, G, GV, eta) do k=1,nz vol_lay(k) = 0.0 diff --git a/src/diagnostics/MOM_wave_speed.F90 b/src/diagnostics/MOM_wave_speed.F90 index 9079124e6a..b84ec40432 100644 --- a/src/diagnostics/MOM_wave_speed.F90 +++ b/src/diagnostics/MOM_wave_speed.F90 @@ -160,10 +160,10 @@ subroutine wave_speed(h, tv, G, GV, cg1, CS, full_halos) endif ; endif S => tv%S ; T => tv%T - g_Rho0 = G%g_Earth/GV%Rho0 + g_Rho0 = GV%g_Earth/GV%Rho0 use_EOS = associated(tv%eqn_of_state) - H_to_pres = G%g_Earth * GV%Rho0 + H_to_pres = GV%g_Earth * GV%Rho0 H_to_m = GV%H_to_m rescale = 1024.0**4 ; I_rescale = 1.0/rescale @@ -515,10 +515,10 @@ subroutine wave_speeds(h, tv, G, GV, nmodes, cn, CS, full_halos) endif ; endif S => tv%S ; T => tv%T - g_Rho0 = G%g_Earth/GV%Rho0 + g_Rho0 = GV%g_Earth/GV%Rho0 use_EOS = associated(tv%eqn_of_state) - H_to_pres = G%g_Earth * GV%Rho0 + H_to_pres = GV%g_Earth * GV%Rho0 H_to_m = GV%H_to_m min_h_frac = tol1 / real(nz) diff --git a/src/diagnostics/MOM_wave_structure.F90 b/src/diagnostics/MOM_wave_structure.F90 index f0767255ed..7c47d88971 100644 --- a/src/diagnostics/MOM_wave_structure.F90 +++ b/src/diagnostics/MOM_wave_structure.F90 @@ -213,10 +213,10 @@ subroutine wave_structure(h, tv, G, GV, cn, ModeNum, freq, CS, En, full_halos) Pi = (4.0*atan(1.0)) S => tv%S ; T => tv%T - g_Rho0 = G%g_Earth/GV%Rho0 + g_Rho0 = GV%g_Earth/GV%Rho0 use_EOS = associated(tv%eqn_of_state) - H_to_pres = G%g_Earth * GV%Rho0 + H_to_pres = GV%g_Earth * GV%Rho0 H_to_m = GV%H_to_m rescale = 1024.0**4 ; I_rescale = 1.0/rescale diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90 index e683388cf6..5f37446db6 100644 --- a/src/initialization/MOM_state_initialization.F90 +++ b/src/initialization/MOM_state_initialization.F90 @@ -712,7 +712,7 @@ subroutine convert_thickness(h, G, GV, param_file, tv) Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB max_itt = 10 Boussinesq = GV%Boussinesq - I_gEarth = 1.0 / G%g_Earth + I_gEarth = 1.0 / GV%g_Earth if (Boussinesq) then call MOM_error(FATAL,"Not yet converting thickness with Boussinesq approx.") @@ -727,7 +727,7 @@ subroutine convert_thickness(h, G, GV, param_file, tv) call calculate_density(tv%T(:,j,k), tv%S(:,j,k), p_top(:,j), rho, & is, ie-is+1, tv%eqn_of_state) do i=is,ie - p_bot(i,j) = p_top(i,j) + G%g_Earth * h(i,j,k) * rho(i) + p_bot(i,j) = p_top(i,j) + GV%g_Earth * h(i,j,k) * rho(i) enddo enddo @@ -741,7 +741,7 @@ subroutine convert_thickness(h, G, GV, param_file, tv) ! The hydrostatic equation is linear to such a ! high degree that no bounds-checking is needed. do i=is,ie - p_bot(i,j) = p_bot(i,j) + rho(i) * (G%g_Earth*h(i,j,k) - dz_geo(i,j)) + p_bot(i,j) = p_bot(i,j) + rho(i) * (GV%g_Earth*h(i,j,k) - dz_geo(i,j)) enddo enddo ; endif enddo @@ -807,7 +807,7 @@ subroutine depress_surface(h, G, GV, param_file, tv) enddo ; enddo ; endif ! Convert thicknesses to interface heights. - call find_eta(h, tv, G%g_Earth, G, GV, eta) + call find_eta(h, tv, GV%g_Earth, G, GV, eta) do j=js,je ; do i=is,ie ; if (G%mask2dT(i,j) > 0.0) then ! if (eta_sfc(i,j) < eta(i,j,nz+1)) then @@ -901,7 +901,7 @@ subroutine trim_for_ice(PF, G, GV, ALE_CSp, tv, h) endif do j=G%jsc,G%jec ; do i=G%isc,G%iec - call cut_off_column_top(GV%ke, tv, GV%Rho0, G%G_earth, G%bathyT(i,j), min_thickness, & + call cut_off_column_top(GV%ke, tv, GV%Rho0, GV%g_Earth, G%bathyT(i,j), min_thickness, & tv%T(i,j,:), T_t(i,j,:), T_b(i,j,:), tv%S(i,j,:), S_t(i,j,:), S_b(i,j,:), & p_surf(i,j), h(i,j,:), remap_CS) enddo ; enddo @@ -2529,14 +2529,14 @@ subroutine MOM_state_init_tests(G, GV, tv) S_t(k) = 35.-(0./500.)*e(k) S(k) = 35.+(0./500.)*z(k) S_b(k) = 35.-(0./500.)*e(k+1) - call calculate_density(0.5*(T_t(k)+T_b(k)), 0.5*(S_t(k)+S_b(k)), -GV%Rho0*G%G_earth*z(k), rho(k), tv%eqn_of_state) - P_tot = P_tot + G%G_earth * rho(k) * h(k) + call calculate_density(0.5*(T_t(k)+T_b(k)), 0.5*(S_t(k)+S_b(k)), -GV%Rho0*GV%g_Earth*z(k), rho(k), tv%eqn_of_state) + P_tot = P_tot + GV%g_Earth * rho(k) * h(k) enddo P_t = 0. do k = 1, nk call find_depth_of_pressure_in_cell(T_t(k), T_b(k), S_t(k), S_b(k), e(K), e(K+1), & - P_t, 0.5*P_tot, GV%Rho0, G%G_earth, tv%eqn_of_state, P_b, z_out) + P_t, 0.5*P_tot, GV%Rho0, GV%g_Earth, tv%eqn_of_state, P_b, z_out) write(0,*) k,P_t,P_b,0.5*P_tot,e(K),e(K+1),z_out P_t = P_b enddo @@ -2546,7 +2546,7 @@ subroutine MOM_state_init_tests(G, GV, tv) write(0,*) ' ==================================================================== ' write(0,*) '' write(0,*) h - call cut_off_column_top(nk, tv, GV%Rho0, G%G_earth, -e(nk+1), GV%Angstrom, & + call cut_off_column_top(nk, tv, GV%Rho0, GV%g_Earth, -e(nk+1), GV%Angstrom, & T, T_t, T_b, S, S_t, S_b, 0.5*P_tot, h, remap_CS) write(0,*) h diff --git a/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90 b/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90 index daa27c6b8c..56b972e9e9 100644 --- a/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90 +++ b/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90 @@ -371,7 +371,7 @@ subroutine calc_slope_functions(h, tv, dt, G, GV, CS) if (.not. ASSOCIATED(CS)) call MOM_error(FATAL, "MOM_lateral_mixing_coeffs.F90, calc_slope_functions:"//& "Module must be initialized before it is used.") - call find_eta(h, tv, G%g_Earth, G, GV, e, halo_size=2) + call find_eta(h, tv, GV%g_Earth, G, GV, e, halo_size=2) if (CS%use_variable_mixing) then if (CS%use_stored_slopes) then call calc_isoneutral_slopes(G, GV, h, e, tv, dt*CS%kappa_smooth, & diff --git a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 index ab939f2cdd..3f35afa4cc 100644 --- a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 +++ b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 @@ -223,7 +223,7 @@ subroutine mixedlayer_restrat_general(h, uhtr, vhtr, tv, fluxes, dt, MLD, G, GV, uDml(:) = 0.0 ; vDml(:) = 0.0 I4dt = 0.25 / dt - g_Rho0 = G%g_Earth/GV%Rho0 + g_Rho0 = GV%g_Earth/GV%Rho0 h_neglect = GV%H_subroundoff dz_neglect = GV%H_subroundoff*GV%H_to_m @@ -465,7 +465,7 @@ subroutine mixedlayer_restrat_BML(h, uhtr, vhtr, tv, fluxes, dt, G, GV, CS) uDml(:) = 0.0 ; vDml(:) = 0.0 I4dt = 0.25 / dt - g_Rho0 = G%g_Earth/GV%Rho0 + g_Rho0 = GV%g_Earth/GV%Rho0 use_EOS = associated(tv%eqn_of_state) h_neglect = GV%H_subroundoff dz_neglect = GV%H_subroundoff*GV%H_to_m diff --git a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 b/src/parameterizations/lateral/MOM_thickness_diffuse.F90 index 03569e6870..1290e6432a 100644 --- a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 +++ b/src/parameterizations/lateral/MOM_thickness_diffuse.F90 @@ -202,7 +202,7 @@ subroutine thickness_diffuse(h, uhtr, vhtr, tv, dt, G, GV, MEKE, VarMix, CDp, CS (dt*(G%IdxCv(i,J)*G%IdxCv(i,J) + G%IdyCv(i,J)*G%IdyCv(i,J))) enddo ; enddo - call find_eta(h, tv, G%g_Earth, G, GV, e, halo_size=1) + call find_eta(h, tv, GV%g_Earth, G, GV, e, halo_size=1) ! Set the diffusivities. !$OMP parallel default(none) shared(is,ie,js,je,Khth_Loc_u,CS,use_VarMix,VarMix, & @@ -546,7 +546,7 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, dt, G, GV, MEK H_to_m = GV%H_to_m ; m_to_H = GV%m_to_H I4dt = 0.25 / dt I_slope_max2 = 1.0 / (CS%slope_max**2) - G_scale = G%g_Earth * H_to_m + G_scale = GV%g_Earth * H_to_m h_neglect = GV%H_subroundoff ; h_neglect2 = h_neglect**2 dz_neglect = GV%H_subroundoff*H_to_m diff --git a/src/parameterizations/vertical/MOM_KPP.F90 b/src/parameterizations/vertical/MOM_KPP.F90 index bebdad862a..7bc9b74187 100644 --- a/src/parameterizations/vertical/MOM_KPP.F90 +++ b/src/parameterizations/vertical/MOM_KPP.F90 @@ -448,7 +448,7 @@ subroutine KPP_calculate(CS, G, GV, h, Temp, Salt, u, v, EOS, uStar, & #endif ! some constants - GoRho = G%g_Earth / GV%Rho0 + GoRho = GV%g_Earth / GV%Rho0 nonLocalTrans(:,:) = 0.0 if (CS%id_Kd_in > 0) call post_data(CS%id_Kd_in, Kt, CS%diag) diff --git a/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 b/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 index 815aebec9a..7ba5896c99 100644 --- a/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 +++ b/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 @@ -563,7 +563,7 @@ subroutine bulkmixedlayer(h_3d, u_3d, v_3d, tv, fluxes, dt, ea, eb, G, GV, CS, & ! rivermix_depth = The prescribed depth over which to mix river inflow ! drho_ds = The gradient of density wrt salt at the ambient surface salinity. ! Sriver = 0 (i.e. rivers are assumed to be pure freshwater) - RmixConst = 0.5*CS%rivermix_depth*G%g_Earth*Irho0**2 + RmixConst = 0.5*CS%rivermix_depth*GV%g_Earth*Irho0**2 do i=is,ie TKE_river(i) = max(0.0, RmixConst*dR0_dS(i)* & (fluxes%lrunoff(i,j) + fluxes%frunoff(i,j)) * S(i,1)) @@ -908,7 +908,7 @@ subroutine convective_adjustment(h, u, v, R0, Rcv, T, S, eps, d_eb, & integer :: is, ie, nz, i, k, k1, nzc, nkmb is = G%isc ; ie = G%iec ; nz = G%ke - g_H2_2Rho0 = (G%g_Earth * GV%H_to_m**2) / (2.0 * GV%Rho0) + g_H2_2Rho0 = (GV%g_Earth * GV%H_to_m**2) / (2.0 * GV%Rho0) nzc = nz ; if (present(nz_conv)) nzc = nz_conv nkmb = CS%nkml+CS%nkbl @@ -1067,7 +1067,7 @@ subroutine mixedlayer_convection(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, & Angstrom = GV%Angstrom C1_3 = 1.0/3.0 ; C1_6 = 1.0/6.0 - g_H2_2Rho0 = (G%g_Earth * GV%H_to_m**2) / (2.0 * GV%Rho0) + g_H2_2Rho0 = (GV%g_Earth * GV%H_to_m**2) / (2.0 * GV%Rho0) Idt = 1.0/dt is = G%isc ; ie = G%iec ; nz = G%ke @@ -1582,7 +1582,7 @@ subroutine mechanical_entrainment(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, & C1_3 = 1.0/3.0 ; C1_6 = 1.0/6.0 ; C1_24 = 1.0/24.0 H_to_m = GV%H_to_m - g_H_2Rho0 = (G%g_Earth * H_to_m) / (2.0 * GV%Rho0) + g_H_2Rho0 = (GV%g_Earth * H_to_m) / (2.0 * GV%Rho0) Hmix_min = CS%Hmix_min * GV%m_to_H h_neglect = GV%H_subroundoff is = G%isc ; ie = G%iec ; nz = G%ke @@ -2323,8 +2323,8 @@ subroutine mixedlayer_detrain_2(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, j, kb1 = CS%nkml+1; kb2 = CS%nkml+2 nkmb = CS%nkml+CS%nkbl h_neglect = GV%H_subroundoff - G_2 = 0.5*G%g_Earth - Rho0xG = GV%Rho0 * G%g_Earth + G_2 = 0.5*GV%g_Earth + Rho0xG = GV%Rho0 * GV%g_Earth Idt_H2 = GV%H_to_m**2 / dt_diag I2Rho0 = 0.5 / GV%Rho0 Angstrom = GV%Angstrom @@ -3122,8 +3122,8 @@ subroutine mixedlayer_detrain_1(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, d_e "CS%nkbl must be 1 in mixedlayer_detrain_1.") Idt = 1.0/dt dt_Time = dt/Timescale - g_H2_2Rho0dt = (G%g_Earth * GV%H_to_m**2) / (2.0 * GV%Rho0 * dt_diag) - g_H2_2dt = (G%g_Earth * GV%H_to_m**2) / (2.0 * dt_diag) + g_H2_2Rho0dt = (GV%g_Earth * GV%H_to_m**2) / (2.0 * GV%Rho0 * dt_diag) + g_H2_2dt = (GV%g_Earth * GV%H_to_m**2) / (2.0 * dt_diag) ! Move detrained water into the buffer layer. do k=1,CS%nkml diff --git a/src/parameterizations/vertical/MOM_diabatic_aux.F90 b/src/parameterizations/vertical/MOM_diabatic_aux.F90 index b11cd75421..48c38aea06 100644 --- a/src/parameterizations/vertical/MOM_diabatic_aux.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_aux.F90 @@ -746,7 +746,7 @@ subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, dia subMLN2(:,j) = 0. rho1(:) = 0. d1(:) = 0. - pRef_N2(:) = G%g_Earth * GV%Rho0 * h(:,j,1) * GV%H_to_m ! Boussinesq approximation!!!! ????? + pRef_N2(:) = GV%g_Earth * GV%Rho0 * h(:,j,1) * GV%H_to_m ! Boussinesq approximation!!!! ????? endif do k = 2, nz dKm1(:) = dK(:) ! Depth of center of layer K-1 @@ -754,7 +754,7 @@ subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, dia ! Stratification, N2, immediately below the mixed layer, averaged over at least 50 m. if (id_N2>0) then - pRef_N2(:) = pRef_N2(:) + G%g_Earth * GV%Rho0 * h(:,j,k) * GV%H_to_m ! Boussinesq approximation!!!! ????? + pRef_N2(:) = pRef_N2(:) + GV%g_Earth * GV%Rho0 * h(:,j,k) * GV%H_to_m ! Boussinesq approximation!!!! ????? call calculate_density(tv%T(:,j,k), tv%S(:,j,k), pRef_N2, rhoAtK, is, ie-is+1, tv%eqn_of_state) do i = is, ie if (MLD(i,j)>0. .and. subMLN2(i,j)==0.) then ! This block is below the mixed layer @@ -762,10 +762,10 @@ subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, dia rho1(i) = rhoAtK(i) d1(i) = dK(i) ! Use pressure at the bottom of the upper layer used in calculating d/dz rho - pRef_N2(i) = pRef_N2(i) + G%g_Earth * GV%Rho0 * h(i,j,k) * GV%H_to_m ! Boussinesq approximation!!!! ????? + pRef_N2(i) = pRef_N2(i) + GV%g_Earth * GV%Rho0 * h(i,j,k) * GV%H_to_m ! Boussinesq approximation!!!! ????? endif if (d1(i)>0. .and. dK(i)-d1(i)>=dz_subML) then - subMLN2(i,j) = G%g_Earth/ GV%Rho0 * (rho1(i)-rhoAtK(i)) / (d1(i) - dK(i)) + subMLN2(i,j) = GV%g_Earth/ GV%Rho0 * (rho1(i)-rhoAtK(i)) / (d1(i) - dK(i)) endif endif enddo ! i-loop @@ -789,7 +789,7 @@ subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, dia if ((MLD(i,j)==0.) .and. (deltaRhoAtK(i)0 .and. subMLN2(i,j)==0. .and. d1(i)>0. .and. dK(i)-d1(i)>0.) then ! ! Use what ever stratification we can, measured over what ever distance is available - ! subMLN2(i,j) = G%g_Earth/ GV%Rho0 * (rho1(i)-rhoAtK(i)) / (d1(i) - dK(i)) + ! subMLN2(i,j) = GV%g_Earth/ GV%Rho0 * (rho1(i)-rhoAtK(i)) / (d1(i) - dK(i)) ! endif enddo enddo ! j-loop @@ -862,8 +862,8 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, ea, h, tv, & Idt = 1.0/dt calculate_energetics = (present(cTKE) .and. present(dSV_dT) .and. present(dSV_dS)) - I_G_Earth = 1.0 / G%G_earth - g_Hconv2 = G%G_earth * GV%H_to_kg_m2**2 + I_G_Earth = 1.0 / GV%g_Earth + g_Hconv2 = GV%g_Earth * GV%H_to_kg_m2**2 if (present(cTKE)) cTKE(:,:,:) = 0.0 @@ -908,7 +908,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, ea, h, tv, & do i=is,ie ; pres(i) = 0.0 ; enddo ! Add surface pressure? do k=1,nz do i=is,ie - d_pres(i) = G%g_Earth * GV%H_to_kg_m2 * h2d(i,k) + d_pres(i) = GV%g_Earth * GV%H_to_kg_m2 * h2d(i,k) p_lay(i) = pres(i) + 0.5*d_pres(i) pres(i) = pres(i) + d_pres(i) enddo diff --git a/src/parameterizations/vertical/MOM_diapyc_energy_req.F90 b/src/parameterizations/vertical/MOM_diapyc_energy_req.F90 index f1f614f516..2713a99a96 100644 --- a/src/parameterizations/vertical/MOM_diapyc_energy_req.F90 +++ b/src/parameterizations/vertical/MOM_diapyc_energy_req.F90 @@ -184,7 +184,7 @@ subroutine diapyc_energy_req_calc(h_in, T_in, S_in, Kd, energy_Kd, dt, tv, G, GV nz = G%ke h_neglect = GV%H_subroundoff - I_G_Earth = 1.0 / G%G_earth + I_G_Earth = 1.0 / GV%g_Earth surface_BL = .true. ; bottom_BL = .true. ; debug = .true. dPEa_dKd(:) = 0.0 ; dPEa_dKd_est(:) = 0.0 ; dPEa_dKd_err(:) = 0.0 ; dPEa_dKd_err_norm(:) = 0.0 ; dPEa_dKd_trunc(:) = 0.0 @@ -195,7 +195,7 @@ subroutine diapyc_energy_req_calc(h_in, T_in, S_in, Kd, energy_Kd, dt, tv, G, GV T0(k) = T_in(k) ; S0(k) = S_in(k) h_tr(k) = h_in(k) htot = htot + h_tr(k) - pres(K+1) = pres(K) + G%g_Earth * GV%H_to_kg_m2 * h_tr(k) + pres(K+1) = pres(K) + GV%g_Earth * GV%H_to_kg_m2 * h_tr(k) p_lay(k) = 0.5*(pres(K) + pres(K+1)) enddo do k=1,nz diff --git a/src/parameterizations/vertical/MOM_diffConvection.F90 b/src/parameterizations/vertical/MOM_diffConvection.F90 index acafdba6ee..e7ba6e668e 100644 --- a/src/parameterizations/vertical/MOM_diffConvection.F90 +++ b/src/parameterizations/vertical/MOM_diffConvection.F90 @@ -115,7 +115,7 @@ subroutine diffConvection_calculate(CS, G, GV, h, Temp, Salt, EOS, Kd_int) real, dimension( G%ke+1 ) :: Kd_1d ! Vertical diffusivity at interfaces (m2/s) real :: GoRho, pRef, rhoK, rhoKm1 - GoRho = G%g_Earth / GV%Rho0 + GoRho = GV%g_Earth / GV%Rho0 N2_1d( 1 ) = 0. N2_1d( G%ke+1 ) = 0. @@ -127,7 +127,7 @@ subroutine diffConvection_calculate(CS, G, GV, h, Temp, Salt, EOS, Kd_int) pRef = 0. ! Ignore atmospheric pressure do K = 2, G%ke ! Pressure at interface K is incremented by mass of level above - pRef = pRef + G%g_Earth * GV%Rho0 * h(i,j,k-1) * GV%H_to_m ! Boussinesq approximation!!!! ????? + pRef = pRef + GV%g_Earth * GV%Rho0 * h(i,j,k-1) * GV%H_to_m ! Boussinesq approximation!!!! ????? ! Compute Brunt-Vaisala frequency (static stability) on interfaces call calculate_density(Temp(i,j,k), Salt(i,j,k), pRef, rhoK, EOS) call calculate_density(Temp(i,j,k-1), Salt(i,j,k-1), pRef, rhoKm1, EOS) diff --git a/src/parameterizations/vertical/MOM_energetic_PBL.F90 b/src/parameterizations/vertical/MOM_energetic_PBL.F90 index f56aca2e39..b14f2389cd 100644 --- a/src/parameterizations/vertical/MOM_energetic_PBL.F90 +++ b/src/parameterizations/vertical/MOM_energetic_PBL.F90 @@ -499,7 +499,7 @@ subroutine energetic_PBL(h_3d, u_3d, v_3d, tv, fluxes, dt, Kd_int, G, GV, CS, & pres(i,1) = 0.0 do k=1,nz dMass = GV%H_to_kg_m2 * h(i,k) - dPres = G%G_Earth * dMass + dPres = GV%g_Earth * dMass dT_to_dPE(i,k) = (dMass * (pres(i,K) + 0.5*dPres)) * dSV_dT(i,j,k) dS_to_dPE(i,k) = (dMass * (pres(i,K) + 0.5*dPres)) * dSV_dS(i,j,k) dT_to_dColHt(i,k) = dMass * dSV_dT(i,j,k) diff --git a/src/parameterizations/vertical/MOM_entrain_diffusive.F90 b/src/parameterizations/vertical/MOM_entrain_diffusive.F90 index 2234be15b9..7bfc0c1070 100644 --- a/src/parameterizations/vertical/MOM_entrain_diffusive.F90 +++ b/src/parameterizations/vertical/MOM_entrain_diffusive.F90 @@ -287,7 +287,7 @@ subroutine entrainment_diffusive(u, v, h, tv, fluxes, dt, G, GV, CS, ea, eb, & H_to_m = GV%H_to_m ; m_to_H = GV%m_to_H tolerance = m_to_H * CS%Tolerance_Ent - g_2dt = 0.5 * G%g_Earth / dt + g_2dt = 0.5 * GV%g_Earth / dt kmb = GV%nk_rho_varies K2 = max(kmb+1,2) ; kb_min = K2 if (.not. CS%bulkmixedlayer) then diff --git a/src/parameterizations/vertical/MOM_internal_tide_input.F90 b/src/parameterizations/vertical/MOM_internal_tide_input.F90 index ba1f90fc06..8201e19962 100644 --- a/src/parameterizations/vertical/MOM_internal_tide_input.F90 +++ b/src/parameterizations/vertical/MOM_internal_tide_input.F90 @@ -194,7 +194,7 @@ subroutine find_N2_bottom(h, tv, T_f, S_f, h2, fluxes, G, GV, N2_bot) logical :: do_i(SZI_(G)), do_any integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke - G_Rho0 = G%g_Earth / GV%Rho0 + G_Rho0 = GV%g_Earth / GV%Rho0 ! Find the (limited) density jump across each interface. do i=is,ie diff --git a/src/parameterizations/vertical/MOM_kappa_shear.F90 b/src/parameterizations/vertical/MOM_kappa_shear.F90 index c5d0527fe7..a67e5aed02 100644 --- a/src/parameterizations/vertical/MOM_kappa_shear.F90 +++ b/src/parameterizations/vertical/MOM_kappa_shear.F90 @@ -319,7 +319,7 @@ subroutine Calculate_kappa_shear(u_in, v_in, h, tv, p_surf, kappa_io, tke_io, & new_kappa = .true. ; if (present(initialize_all)) new_kappa = initialize_all Ri_crit = CS%Rino_crit - gR0 = GV%Rho0*G%g_Earth ; g_R0 = G%g_Earth/GV%Rho0 + gR0 = GV%Rho0*GV%g_Earth ; g_R0 = GV%g_Earth/GV%Rho0 k0dt = dt*CS%kappa_0 dz_massless = 0.1*sqrt(k0dt) diff --git a/src/parameterizations/vertical/MOM_set_diffusivity.F90 b/src/parameterizations/vertical/MOM_set_diffusivity.F90 index 1cab09531f..91ef59caea 100644 --- a/src/parameterizations/vertical/MOM_set_diffusivity.F90 +++ b/src/parameterizations/vertical/MOM_set_diffusivity.F90 @@ -996,7 +996,7 @@ subroutine find_TKE_to_Kd(h, tv, dRho_int, N2_lay, j, dt, G, GV, CS, & I_dt = 1.0/dt Omega2 = CS%Omega**2 - G_Rho0 = G%g_Earth / GV%Rho0 + G_Rho0 = GV%g_Earth / GV%Rho0 H_neglect = GV%H_subroundoff I_Rho0 = 1.0/GV%Rho0 @@ -1121,11 +1121,11 @@ subroutine find_TKE_to_Kd(h, tv, dRho_int, N2_lay, j, dt, G, GV, CS, & ! ### This should be 1 / G_Earth * (delta rho_InSitu) ! kappa_max = I_dt * dRho_int(i,K+1) * maxEnt(i,k) * & ! (GV%H_to_m*h(i,j,k) + dh_max) / dRho_lay - ! maxTKE(i,k) = G%g_Earth * dRho_lay * kappa_max + ! maxTKE(i,k) = GV%g_Earth * dRho_lay * kappa_max ! dRho_int should already be non-negative, so the max is redundant? dh_max = maxEnt(i,k) * (1.0 + dsp1_ds(i,k)) dRho_lay = 0.5 * max(dRho_int(i,K) + dRho_int(i,K+1), 0.0) - maxTKE(i,k) = I_dt * ((G%g_Earth * I_Rho0) * & + maxTKE(i,k) = I_dt * ((GV%g_Earth * I_Rho0) * & (0.5*max(dRho_int(i,K+1) + dsp1_ds(i,k)*dRho_int(i,K),0.0))) * & ((GV%H_to_m*h(i,j,k) + dh_max) * maxEnt(i,k)) TKE_to_Kd(i,k) = 1.0 / (G_Rho0 * dRho_lay + & @@ -1172,7 +1172,7 @@ subroutine find_N2(h, tv, T_f, S_f, fluxes, j, G, GV, CS, dRho_int, & integer :: i, k, is, ie, nz is = G%isc ; ie = G%iec ; nz = G%ke - G_Rho0 = G%g_Earth / GV%Rho0 + G_Rho0 = GV%g_Earth / GV%Rho0 H_neglect = GV%H_subroundoff ! Find the (limited) density jump across each interface. @@ -1444,7 +1444,7 @@ subroutine add_drag_diffusivity(h, u, v, tv, fluxes, visc, j, TKE_to_Kd, & if (associated(visc%Ray_u) .and. associated(visc%Ray_v)) Rayleigh_drag = .true. I_Rho0 = 1.0/GV%Rho0 - R0_g = GV%Rho0/G%g_Earth + R0_g = GV%Rho0/GV%g_Earth do K=2,nz ; Rint(K) = 0.5*(GV%Rlay(k-1)+GV%Rlay(k)) ; enddo @@ -2433,7 +2433,7 @@ subroutine set_density_ratios(h, tv, kb, G, GV, CS, j, ds_dsp1, rho_0) enddo if (CS%bulkmixedlayer) then - g_R0 = G%g_Earth/GV%Rho0 + g_R0 = GV%g_Earth/GV%Rho0 kmb = GV%nk_rho_varies eps = 0.1 do i=is,ie ; p_ref(i) = tv%P_Ref ; enddo diff --git a/src/parameterizations/vertical/MOM_set_viscosity.F90 b/src/parameterizations/vertical/MOM_set_viscosity.F90 index 2d7813586f..ef46c1f8e0 100644 --- a/src/parameterizations/vertical/MOM_set_viscosity.F90 +++ b/src/parameterizations/vertical/MOM_set_viscosity.F90 @@ -287,7 +287,7 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, CS) Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB nkmb = GV%nk_rho_varies ; nkml = GV%nkml h_neglect = GV%H_subroundoff - Rho0x400_G = 400.0*(GV%Rho0/G%g_Earth)*GV%m_to_H + Rho0x400_G = 400.0*(GV%Rho0/GV%g_Earth)*GV%m_to_H Vol_quit = 0.9*GV%Angstrom + h_neglect H_to_m = GV%H_to_m ; m_to_H = GV%m_to_H C2pi_3 = 8.0*atan(1.0)/3.0 @@ -990,7 +990,7 @@ subroutine set_viscous_ML(u, v, h, tv, fluxes, visc, dt, G, GV, CS) "Module must be initialized before it is used.") if (.not.(CS%dynamic_viscous_ML .or. associated(fluxes%frac_shelf_h))) return - Rho0x400_G = 400.0*(GV%Rho0/G%g_Earth)*GV%m_to_H + Rho0x400_G = 400.0*(GV%Rho0/GV%g_Earth)*GV%m_to_H U_bg_sq = CS%drag_bg_vel * CS%drag_bg_vel cdrag_sqrt=sqrt(CS%cdrag) @@ -998,7 +998,7 @@ subroutine set_viscous_ML(u, v, h, tv, fluxes, visc, dt, G, GV, CS) dt_Rho0 = dt/GV%H_to_kg_m2 h_neglect = GV%H_subroundoff h_tiny = 2.0*GV%Angstrom + h_neglect - g_H_Rho0 = (G%g_Earth * GV%H_to_m) / GV%Rho0 + g_H_Rho0 = (GV%g_Earth * GV%H_to_m) / GV%Rho0 H_to_m = GV%H_to_m ; m_to_H = GV%m_to_H if (associated(fluxes%frac_shelf_h)) then diff --git a/src/parameterizations/vertical/MOM_shortwave_abs.F90 b/src/parameterizations/vertical/MOM_shortwave_abs.F90 index 54e1c53d36..e384efba55 100644 --- a/src/parameterizations/vertical/MOM_shortwave_abs.F90 +++ b/src/parameterizations/vertical/MOM_shortwave_abs.F90 @@ -174,7 +174,7 @@ subroutine absorbRemainingSW(G, GV, h, opacity_band, nsw, j, dt, H_limit_fluxes, C1_6 = 1.0 / 6.0 ; C1_60 = 1.0 / 60.0 TKE_calc = (present(TKE) .and. present(dSV_dT)) - g_Hconv2 = G%G_earth * GV%H_to_kg_m2**2 + g_Hconv2 = GV%g_Earth * GV%H_to_kg_m2**2 h_heat(:) = 0.0 if (present(htot)) then ; do i=is,ie ; h_heat(i) = htot(i) ; enddo ; endif diff --git a/src/user/DOME_initialization.F90 b/src/user/DOME_initialization.F90 index 2a8c22c04f..3d5e2c87a5 100644 --- a/src/user/DOME_initialization.F90 +++ b/src/user/DOME_initialization.F90 @@ -358,7 +358,7 @@ subroutine DOME_set_Open_Bdry_Conds(OBC, tv, G, GV, param_file, tr_Reg) endif if (apply_OBC_v) then - g_prime_tot = (G%g_Earth/GV%Rho0)*2.0 + g_prime_tot = (GV%g_Earth/GV%Rho0)*2.0 Def_Rad = sqrt(D_edge*g_prime_tot) / (1.0e-4*1000.0) tr_0 = (-D_edge*sqrt(D_edge*g_prime_tot)*0.5e3*Def_Rad) * GV%m_to_H diff --git a/src/user/Rossby_front_2d_initialization.F90 b/src/user/Rossby_front_2d_initialization.F90 index dd55e8324a..69a22ca757 100644 --- a/src/user/Rossby_front_2d_initialization.F90 +++ b/src/user/Rossby_front_2d_initialization.F90 @@ -166,7 +166,7 @@ subroutine Rossby_front_initialize_velocity(u, v, h, G, GV, param_file) do j = G%jsc,G%jec ; do I = G%isc-1,G%iec+1 f = 0.5*( G%CoriolisBu(I,j) + G%CoriolisBu(I,j-1) ) dUdT = 0.0 ; if (abs(f) > 0.0) & - dUdT = ( G%g_Earth * dRho_dT ) / ( f * GV%Rho0 ) + dUdT = ( GV%g_Earth * dRho_dT ) / ( f * GV%Rho0 ) Dml = Hml( G, G%geoLatT(i,j) ) Ty = dTdy( G, T_range, G%geoLatT(i,j) ) zi = 0.