Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into dev/esmg
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallberg-NOAA authored Apr 14, 2022
2 parents 1383961 + d729c67 commit b9697e2
Show file tree
Hide file tree
Showing 70 changed files with 2,181 additions and 616 deletions.
6 changes: 3 additions & 3 deletions .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ build/openmp/Makefile: MOM_ACFLAGS=--enable-openmp
build/target/Makefile: MOM_ACFLAGS=
build/opt/Makefile: MOM_ACFLAGS=
build/opt_target/Makefile: MOM_ACFLAGS=
build/coupled/Makefile: MOM_ACFLAGS=--with-driver=coupled_driver
build/nuopc/Makefile: MOM_ACFLAGS=--with-driver=nuopc_driver
build/mct/Makefile: MOM_ACFLAGS=--with-driver=mct_driver
build/coupled/Makefile: MOM_ACFLAGS=--with-driver=FMS_cap
build/nuopc/Makefile: MOM_ACFLAGS=--with-driver=nuopc_cap
build/mct/Makefile: MOM_ACFLAGS=--with-driver=mct_cap

# Fetch regression target source code
build/target/Makefile: | $(TARGET_CODEBASE)
Expand Down
22 changes: 11 additions & 11 deletions config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
fluxes%salt_flux_added(is:ie,js:je) = fluxes%salt_flux(is:ie,js:je) ! Diagnostic
else
do j=js,je ; do i=is,ie
if (G%mask2dT(i,j) > 0.5) then
if (G%mask2dT(i,j) > 0.0) then
delta_sss = sfc_state%SSS(i,j) - data_restore(i,j)
delta_sss = sign(1.0,delta_sss)*min(abs(delta_sss),CS%max_delta_srestore)
fluxes%vprec(i,j) = (CS%basin_mask(i,j)*open_ocn_mask(i,j)*CS%srestore_mask(i,j))* &
Expand Down Expand Up @@ -956,13 +956,13 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
if (present(taux).and.present(tauy)) then
do j=jsh,jeh ; do I=Isqh,Ieqh
taux(I,j) = 0.0
if ((G%mask2dBu(I,J) + G%mask2dBu(I,J-1)) > 0) &
if ((G%mask2dBu(I,J) + G%mask2dBu(I,J-1)) > 0.0) &
taux(I,j) = (G%mask2dBu(I,J)*taux_in_B(I,J) + G%mask2dBu(I,J-1)*taux_in_B(I,J-1)) / &
(G%mask2dBu(I,J) + G%mask2dBu(I,J-1))
enddo ; enddo
do J=Jsqh,Jeqh ; do i=ish,ieh
tauy(i,J) = 0.0
if ((G%mask2dBu(I,J) + G%mask2dBu(I-1,J)) > 0) &
if ((G%mask2dBu(I,J) + G%mask2dBu(I-1,J)) > 0.0) &
tauy(i,J) = (G%mask2dBu(I,J)*tauy_in_B(I,J) + G%mask2dBu(I-1,J)*tauy_in_B(I-1,J)) / &
(G%mask2dBu(I,J) + G%mask2dBu(I-1,J))
enddo ; enddo
Expand All @@ -984,14 +984,14 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,

if (present(taux)) then ; do j=jsh,jeh ; do I=Isqh,Ieqh
taux(I,j) = 0.0
if ((G%mask2dT(i,j) + G%mask2dT(i+1,j)) > 0) &
if ((G%mask2dT(i,j) + G%mask2dT(i+1,j)) > 0.0) &
taux(I,j) = (G%mask2dT(i,j)*taux_in_A(i,j) + G%mask2dT(i+1,j)*taux_in_A(i+1,j)) / &
(G%mask2dT(i,j) + G%mask2dT(i+1,j))
enddo ; enddo ; endif

if (present(tauy)) then ; do J=Jsqh,Jeqh ; do i=ish,ieh
tauy(i,J) = 0.0
if ((G%mask2dT(i,j) + G%mask2dT(i,j+1)) > 0) &
if ((G%mask2dT(i,j) + G%mask2dT(i,j+1)) > 0.0) &
tauy(i,J) = (G%mask2dT(i,j)*tauy_in_A(i,j) + G%mask2dT(i,J+1)*tauy_in_A(i,j+1)) / &
(G%mask2dT(i,j) + G%mask2dT(i,j+1))
enddo ; enddo ; endif
Expand Down Expand Up @@ -1029,10 +1029,10 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
gustiness = CS%gust_const
if (CS%read_gust_2d) then
if ((wind_stagger == CGRID_NE) .or. &
((wind_stagger == AGRID) .and. (G%mask2dT(i,j) > 0)) .or. &
((wind_stagger == AGRID) .and. (G%mask2dT(i,j) > 0.0)) .or. &
((wind_stagger == BGRID_NE) .and. &
(((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0)) ) &
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0)) ) &
gustiness = CS%gust(i,j)
endif
ustar(i,j) = sqrt(gustiness*IRho0 + IRho0*Pa_conversion*IOB%stress_mag(i-i0,j-j0))
Expand All @@ -1050,7 +1050,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
do j=js,je ; do i=is,ie
tau_mag = 0.0 ; gustiness = CS%gust_const
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0) then
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
tau_mag = sqrt(((G%mask2dBu(I,J)*(taux_in_B(I,J)**2 + tauy_in_B(I,J)**2) + &
G%mask2dBu(I-1,J-1)*(taux_in_B(I-1,J-1)**2 + tauy_in_B(I-1,J-1)**2)) + &
(G%mask2dBu(I,J-1)*(taux_in_B(I,J-1)**2 + tauy_in_B(I,J-1)**2) + &
Expand All @@ -1069,7 +1069,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
do j=js,je ; do i=is,ie
tau_mag = G%mask2dT(i,j) * sqrt(taux_in_A(i,j)**2 + tauy_in_A(i,j)**2)
gustiness = CS%gust_const
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0)) gustiness = CS%gust(i,j)
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
if (do_ustar) ustar(i,j) = sqrt(gustiness*IRho0 + IRho0 * tau_mag)
if (CS%answers_2018) then
if (do_gustless) gustless_ustar(i,j) = sqrt(US%L_to_Z*tau_mag / CS%Rho0)
Expand All @@ -1080,10 +1080,10 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
else ! C-grid wind stresses.
do j=js,je ; do i=is,ie
taux2 = 0.0 ; tauy2 = 0.0
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0) &
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0.0) &
taux2 = (G%mask2dCu(I-1,j)*taux_in_C(I-1,j)**2 + G%mask2dCu(I,j)*taux_in_C(I,j)**2) / &
(G%mask2dCu(I-1,j) + G%mask2dCu(I,j))
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0) &
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
tauy2 = (G%mask2dCv(i,J-1)*tauy_in_C(i,J-1)**2 + G%mask2dCv(i,J)*tauy_in_C(i,J)**2) / &
(G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
tau_mag = sqrt(taux2 + tauy2)
Expand Down
19 changes: 9 additions & 10 deletions config_src/drivers/mct_cap/mom_surface_forcing_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module MOM_surface_forcing_mct
use MOM_diag_mediator, only : diag_ctrl
use MOM_diag_mediator, only : safe_alloc_ptr, time_type
use MOM_domains, only : pass_vector, pass_var, fill_symmetric_edges
use MOM_domains, only : global_field_sum, BITWISE_EXACT_SUM
use MOM_domains, only : AGRID, BGRID_NE, CGRID_NE, To_All
use MOM_domains, only : To_North, To_East, Omit_Corners
use MOM_error_handler, only : MOM_error, WARNING, FATAL, is_root_pe, MOM_mesg
Expand Down Expand Up @@ -385,7 +384,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
fluxes%salt_flux_added(is:ie,js:je) = fluxes%salt_flux(is:ie,js:je) ! Diagnostic
else
do j=js,je ; do i=is,ie
if (G%mask2dT(i,j) > 0.5) then
if (G%mask2dT(i,j) > 0.0) then
delta_sss = sfc_state%SSS(i,j) - data_restore(i,j)
delta_sss = sign(1.0,delta_sss)*min(abs(delta_sss),CS%max_delta_srestore)
fluxes%vprec(i,j) = (CS%basin_mask(i,j)*open_ocn_mask(i,j)*CS%srestore_mask(i,j))* &
Expand Down Expand Up @@ -749,15 +748,15 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)

do j=js,je ; do I=Isq,Ieq
forces%taux(I,j) = 0.0
if ((G%mask2dBu(I,J) + G%mask2dBu(I,J-1)) > 0) &
if ((G%mask2dBu(I,J) + G%mask2dBu(I,J-1)) > 0.0) &
forces%taux(I,j) = (G%mask2dBu(I,J)*taux_at_q(I,J) + &
G%mask2dBu(I,J-1)*taux_at_q(I,J-1)) / &
(G%mask2dBu(I,J) + G%mask2dBu(I,J-1))
enddo; enddo

do J=Jsq,Jeq ; do i=is,ie
forces%tauy(i,J) = 0.0
if ((G%mask2dBu(I,J) + G%mask2dBu(I-1,J)) > 0) &
if ((G%mask2dBu(I,J) + G%mask2dBu(I-1,J)) > 0.0) &
forces%tauy(i,J) = (G%mask2dBu(I,J)*tauy_at_q(I,J) + &
G%mask2dBu(I-1,J)*tauy_at_q(I-1,J)) / &
(G%mask2dBu(I,J) + G%mask2dBu(I-1,J))
Expand All @@ -770,7 +769,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
do j=js,je ; do i=is,ie
tau_mag = 0.0 ; gustiness = CS%gust_const
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0) then
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
tau_mag = sqrt(((G%mask2dBu(I,J)*(taux_at_q(I,J)**2 + tauy_at_q(I,J)**2) + &
G%mask2dBu(I-1,J-1)*(taux_at_q(I-1,J-1)**2 + tauy_at_q(I-1,J-1)**2)) + &
(G%mask2dBu(I,J-1)*(taux_at_q(I,J-1)**2 + tauy_at_q(I,J-1)**2) + &
Expand All @@ -786,23 +785,23 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)

do j=js,je ; do I=Isq,Ieq
forces%taux(I,j) = 0.0
if ((G%mask2dT(i,j) + G%mask2dT(i+1,j)) > 0) &
if ((G%mask2dT(i,j) + G%mask2dT(i+1,j)) > 0.0) &
forces%taux(I,j) = (G%mask2dT(i,j)*taux_at_h(i,j) + &
G%mask2dT(i+1,j)*taux_at_h(i+1,j)) / &
(G%mask2dT(i,j) + G%mask2dT(i+1,j))
enddo; enddo

do J=Jsq,Jeq ; do i=is,ie
forces%tauy(i,J) = 0.0
if ((G%mask2dT(i,j) + G%mask2dT(i,j+1)) > 0) &
if ((G%mask2dT(i,j) + G%mask2dT(i,j+1)) > 0.0) &
forces%tauy(i,J) = (G%mask2dT(i,j)*tauy_at_h(i,j) + &
G%mask2dT(i,J+1)*tauy_at_h(i,j+1)) / &
(G%mask2dT(i,j) + G%mask2dT(i,j+1))
enddo; enddo

do j=js,je ; do i=is,ie
gustiness = CS%gust_const
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0)) gustiness = CS%gust(i,j)
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0 * G%mask2dT(i,j) * &
sqrt(taux_at_h(i,j)**2 + tauy_at_h(i,j)**2))
enddo; enddo
Expand All @@ -814,12 +813,12 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)

do j=js,je ; do i=is,ie
taux2 = 0.0
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0) &
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0.0) &
taux2 = (G%mask2dCu(I-1,j)*forces%taux(I-1,j)**2 + &
G%mask2dCu(I,j)*forces%taux(I,j)**2) / (G%mask2dCu(I-1,j) + G%mask2dCu(I,j))

tauy2 = 0.0
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0) &
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
tauy2 = (G%mask2dCv(i,J-1)*forces%tauy(i,J-1)**2 + &
G%mask2dCv(i,J)*forces%tauy(i,J)**2) / (G%mask2dCv(i,J-1) + G%mask2dCv(i,J))

Expand Down
19 changes: 9 additions & 10 deletions config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module MOM_surface_forcing_nuopc
use MOM_diag_mediator, only : diag_ctrl
use MOM_diag_mediator, only : safe_alloc_ptr, time_type
use MOM_domains, only : pass_vector, pass_var, fill_symmetric_edges
use MOM_domains, only : global_field_sum, BITWISE_EXACT_SUM
use MOM_domains, only : AGRID, BGRID_NE, CGRID_NE, To_All
use MOM_domains, only : To_North, To_East, Omit_Corners
use MOM_error_handler, only : MOM_error, WARNING, FATAL, is_root_pe, MOM_mesg
Expand Down Expand Up @@ -410,7 +409,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
fluxes%salt_flux_added(is:ie,js:je) = fluxes%salt_flux(is:ie,js:je) ! Diagnostic
else
do j=js,je ; do i=is,ie
if (G%mask2dT(i,j) > 0.5) then
if (G%mask2dT(i,j) > 0.0) then
delta_sss = sfc_state%SSS(i,j) - data_restore(i,j)
delta_sss = sign(1.0,delta_sss)*min(abs(delta_sss),CS%max_delta_srestore)
fluxes%vprec(i,j) = (CS%basin_mask(i,j)*open_ocn_mask(i,j)*CS%srestore_mask(i,j))* &
Expand Down Expand Up @@ -806,15 +805,15 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)

do j=js,je ; do I=Isq,Ieq
forces%taux(I,j) = 0.0
if ((G%mask2dBu(I,J) + G%mask2dBu(I,J-1)) > 0) &
if ((G%mask2dBu(I,J) + G%mask2dBu(I,J-1)) > 0.0) &
forces%taux(I,j) = (G%mask2dBu(I,J)*taux_at_q(I,J) + &
G%mask2dBu(I,J-1)*taux_at_q(I,J-1)) / &
(G%mask2dBu(I,J) + G%mask2dBu(I,J-1))
enddo ; enddo

do J=Jsq,Jeq ; do i=is,ie
forces%tauy(i,J) = 0.0
if ((G%mask2dBu(I,J) + G%mask2dBu(I-1,J)) > 0) &
if ((G%mask2dBu(I,J) + G%mask2dBu(I-1,J)) > 0.0) &
forces%tauy(i,J) = (G%mask2dBu(I,J)*tauy_at_q(I,J) + &
G%mask2dBu(I-1,J)*tauy_at_q(I-1,J)) / &
(G%mask2dBu(I,J) + G%mask2dBu(I-1,J))
Expand All @@ -827,7 +826,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
do j=js,je ; do i=is,ie
tau_mag = 0.0 ; gustiness = CS%gust_const
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0) then
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
tau_mag = sqrt(((G%mask2dBu(I,J)*(taux_at_q(I,J)**2 + tauy_at_q(I,J)**2) + &
G%mask2dBu(I-1,J-1)*(taux_at_q(I-1,J-1)**2 + tauy_at_q(I-1,J-1)**2)) + &
(G%mask2dBu(I,J-1)*(taux_at_q(I,J-1)**2 + tauy_at_q(I,J-1)**2) + &
Expand All @@ -843,23 +842,23 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)

do j=js,je ; do I=Isq,Ieq
forces%taux(I,j) = 0.0
if ((G%mask2dT(i,j) + G%mask2dT(i+1,j)) > 0) &
if ((G%mask2dT(i,j) + G%mask2dT(i+1,j)) > 0.0) &
forces%taux(I,j) = (G%mask2dT(i,j)*taux_at_h(i,j) + &
G%mask2dT(i+1,j)*taux_at_h(i+1,j)) / &
(G%mask2dT(i,j) + G%mask2dT(i+1,j))
enddo ; enddo

do J=Jsq,Jeq ; do i=is,ie
forces%tauy(i,J) = 0.0
if ((G%mask2dT(i,j) + G%mask2dT(i,j+1)) > 0) &
if ((G%mask2dT(i,j) + G%mask2dT(i,j+1)) > 0.0) &
forces%tauy(i,J) = (G%mask2dT(i,j)*tauy_at_h(i,j) + &
G%mask2dT(i,J+1)*tauy_at_h(i,j+1)) / &
(G%mask2dT(i,j) + G%mask2dT(i,j+1))
enddo ; enddo

do j=js,je ; do i=is,ie
gustiness = CS%gust_const
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0)) gustiness = CS%gust(i,j)
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0 * G%mask2dT(i,j) * &
sqrt(taux_at_h(i,j)**2 + tauy_at_h(i,j)**2))
enddo ; enddo
Expand All @@ -871,12 +870,12 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)

do j=js,je ; do i=is,ie
taux2 = 0.0
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0) &
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0.0) &
taux2 = (G%mask2dCu(I-1,j)*forces%taux(I-1,j)**2 + &
G%mask2dCu(I,j)*forces%taux(I,j)**2) / (G%mask2dCu(I-1,j) + G%mask2dCu(I,j))

tauy2 = 0.0
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0) &
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
tauy2 = (G%mask2dCv(i,J-1)*forces%tauy(i,J-1)**2 + &
G%mask2dCv(i,J)*forces%tauy(i,J)**2) / (G%mask2dCv(i,J-1) + G%mask2dCv(i,J))

Expand Down
2 changes: 1 addition & 1 deletion config_src/drivers/solo_driver/MESO_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
do j=js,je ; do i=is,ie
! Set Temp_restore and Salin_restore to the temperature (in degC) and
! salinity (in ppt or PSU) that are being restored toward.
if (G%mask2dT(i,j) > 0) then
if (G%mask2dT(i,j) > 0.0) then
fluxes%heat_added(i,j) = G%mask2dT(i,j) * &
((CS%T_Restore(i,j) - sfc_state%SST(i,j)) * rhoXcp * CS%Flux_const)
fluxes%vprec(i,j) = - (CS%Rho0 * CS%Flux_const) * &
Expand Down
12 changes: 6 additions & 6 deletions config_src/drivers/solo_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ subroutine buoyancy_forcing_from_files(sfc_state, fluxes, day, dt, G, US, CS)

if (CS%use_temperature) then
do j=js,je ; do i=is,ie
if (G%mask2dT(i,j) > 0) then
if (G%mask2dT(i,j) > 0.0) then
fluxes%heat_added(i,j) = G%mask2dT(i,j) * &
((CS%T_Restore(i,j) - sfc_state%SST(i,j)) * rhoXcp * CS%Flux_const_T)
fluxes%vprec(i,j) = - (CS%Rho0*CS%Flux_const_S) * &
Expand All @@ -1138,7 +1138,7 @@ subroutine buoyancy_forcing_from_files(sfc_state, fluxes, day, dt, G, US, CS)
enddo ; enddo
else
do j=js,je ; do i=is,ie
if (G%mask2dT(i,j) > 0) then
if (G%mask2dT(i,j) > 0.0) then
fluxes%buoy(i,j) = (CS%Dens_Restore(i,j) - sfc_state%sfc_density(i,j)) * &
(CS%G_Earth * CS%Flux_const / CS%Rho0)
else
Expand Down Expand Up @@ -1231,7 +1231,7 @@ subroutine buoyancy_forcing_from_data_override(sfc_state, fluxes, day, dt, G, US
if (CS%restorebuoy) then
if (CS%use_temperature) then
do j=js,je ; do i=is,ie
if (G%mask2dT(i,j) > 0) then
if (G%mask2dT(i,j) > 0.0) then
fluxes%heat_added(i,j) = G%mask2dT(i,j) * &
((CS%T_Restore(i,j) - sfc_state%SST(i,j)) * rhoXcp * CS%Flux_const_T)
fluxes%vprec(i,j) = - (CS%Rho0*CS%Flux_const_S) * &
Expand All @@ -1244,7 +1244,7 @@ subroutine buoyancy_forcing_from_data_override(sfc_state, fluxes, day, dt, G, US
enddo ; enddo
else
do j=js,je ; do i=is,ie
if (G%mask2dT(i,j) > 0) then
if (G%mask2dT(i,j) > 0.0) then
fluxes%buoy(i,j) = (CS%Dens_Restore(i,j) - sfc_state%sfc_density(i,j)) * &
(CS%G_Earth * CS%Flux_const / CS%Rho0)
else
Expand Down Expand Up @@ -1431,7 +1431,7 @@ subroutine buoyancy_forcing_linear(sfc_state, fluxes, day, dt, G, US, CS)
y = (G%geoLatCu(I,j)-CS%South_lat)/CS%len_lat
T_restore = CS%T_south + (CS%T_north-CS%T_south)*y
S_restore = CS%S_south + (CS%S_north-CS%S_south)*y
if (G%mask2dT(i,j) > 0) then
if (G%mask2dT(i,j) > 0.0) then
fluxes%heat_added(i,j) = G%mask2dT(i,j) * &
((T_Restore - sfc_state%SST(i,j)) * ((CS%Rho0 * fluxes%C_p) * CS%Flux_const))
fluxes%vprec(i,j) = - (CS%Rho0*CS%Flux_const) * &
Expand All @@ -1446,7 +1446,7 @@ subroutine buoyancy_forcing_linear(sfc_state, fluxes, day, dt, G, US, CS)
call MOM_error(FATAL, "buoyancy_forcing_linear in MOM_surface_forcing: "// &
"RESTOREBUOY to linear not written yet.")
!do j=js,je ; do i=is,ie
! if (G%mask2dT(i,j) > 0) then
! if (G%mask2dT(i,j) > 0.0) then
! fluxes%buoy(i,j) = (CS%Dens_Restore(i,j) - sfc_state%sfc_density(i,j)) * &
! (CS%G_Earth * CS%Flux_const / CS%Rho0)
! else
Expand Down
4 changes: 2 additions & 2 deletions config_src/external/GFDL_ocean_BGC/FMS_coupler_util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module FMS_coupler_util
!> Get element and index of a boundary condition
subroutine extract_coupler_values(BC_struc, BC_index, BC_element, array_out, ilb, jlb, &
is, ie, js, je, conversion)
real, dimension(ilb:,jlb:),intent(out) :: array_out !< The array being filled with the input values
integer, intent(in) :: ilb !< Lower bounds
integer, intent(in) :: jlb !< Lower bounds
real, dimension(ilb:,jlb:),intent(out) :: array_out !< The array being filled with the input values
type(coupler_2d_bc_type), intent(in) :: BC_struc !< The type from which the data is being extracted
integer, intent(in) :: BC_index !< The boundary condition number being extracted
integer, intent(in) :: BC_element !< The element of the boundary condition being extracted
Expand All @@ -27,9 +27,9 @@ end subroutine extract_coupler_values
!> Set element and index of a boundary condition
subroutine set_coupler_values(array_in, BC_struc, BC_index, BC_element, ilb, jlb,&
is, ie, js, je, conversion)
real, dimension(ilb:,jlb:), intent(in) :: array_in !< The array containing the values to load into the BC
integer, intent(in) :: ilb !< Lower bounds
integer, intent(in) :: jlb !< Lower bounds
real, dimension(ilb:,jlb:), intent(in) :: array_in !< The array containing the values to load into the BC
type(coupler_2d_bc_type), intent(inout) :: BC_struc !< The type into which the data is being loaded
integer, intent(in) :: BC_index !< The boundary condition number being set
integer, intent(in) :: BC_element !< The element of the boundary condition being set
Expand Down
Loading

0 comments on commit b9697e2

Please sign in to comment.