Skip to content

Commit

Permalink
Merge pull request #51 from NOAA-GFDL/dev/gfdl
Browse files Browse the repository at this point in the history
Merge in dev/gfdl updates
  • Loading branch information
wrongkindofdoctor authored Mar 9, 2020
2 parents 7adcc90 + 79c86c3 commit 8d7be68
Show file tree
Hide file tree
Showing 34 changed files with 668 additions and 1,107 deletions.
77 changes: 42 additions & 35 deletions .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ DO_REPRO_TESTS ?= true

#---
# Dependencies
BASE = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/..
DEPS = $(BASE)/deps
BUILD = $(BASE)/build
DEPS = deps

# mkmf, list_paths (GFDL build toolchain)
MKMF_URL ?= https://github.com/NOAA-GFDL/mkmf.git
Expand All @@ -21,7 +19,7 @@ MKMF := $(abspath $(DEPS)/mkmf/bin/mkmf)

# FMS framework
FMS_URL ?= https://github.com/NOAA-GFDL/FMS.git
FMS_COMMIT ?= f2e2c86f6c0eb6d389a20509a8a60fa22924e16b
FMS_COMMIT ?= 2019.01.01
FMS := $(DEPS)/fms

#---
Expand All @@ -33,8 +31,8 @@ MKMF_CPP = "-Duse_libMPI -Duse_netCDF -DSPMD"
# Environment
# TODO: This info ought to be determined by CMake, automake, etc.
#MKMF_TEMPLATE ?= .testing/linux-ubuntu-xenial-gnu.mk
MKMF_TEMPLATE ?= $(DEPS)/mkmf/templates/ncrc-gnu.mk
#MKMF_TEMPLATE ?= $(DEPS)/mkmf/templates/ncrc-intel.mk
MKMF_TEMPLATE ?= build/mkmf/templates/ncrc-gnu.mk
#MKMF_TEMPLATE ?= build/mkmf/templates/ncrc-intel.mk

#---
# Test configuration
Expand Down Expand Up @@ -71,67 +69,76 @@ ifeq ($(DO_REGRESSION_TESTS), true)
MOM_TARGET_LOCAL_BRANCH ?= dev/gfdl
MOM_TARGET_BRANCH := origin/$(MOM_TARGET_LOCAL_BRANCH)

TARGET_CODEBASE = $(BUILD)/target_codebase
TARGET_CODEBASE = build/target_codebase
else
MOM_TARGET_URL =
MOM_TARGET_BRANCH =
TARGET_CODEBASE =
endif

SOURCE = $(wildcard $(BASE)/src/*/*.F90 $(BASE)/src/*/*/*.F90 $(BASE)/config_src/solo_driver/*.F90)
# List of source files to link this Makefile's dependencies to model Makefiles
# Assumes a depth of two, and the following extensions: F90 inc c h
# (1): Root directory
# NOTE: extensions could be a second variable
SOURCE = \
$(foreach ext,F90 inc c h,$(wildcard $(1)/*/*.$(ext) $(1)/*/*/*.$(ext)))

MOM_SOURCE = $(call SOURCE,../src) $(wildcard ../config_src/solo_driver/*.F90)
TARGET_SOURCE = $(call SOURCE,build/target_codebase/src) \
$(wildcard build/target_codebase/config_src/solo_driver/*.F90)
FMS_SOURCE = $(call SOURCE,$(DEPS)/fms/src)

#---
# Rules

.PHONY: all build.regressions
all: $(foreach b,$(BUILDS),$(BUILD)/$(b)/MOM6)
build.regressions: $(foreach b,symmetric target,$(BUILD)/$(b)/MOM6)
all: $(foreach b,$(BUILDS),build/$(b)/MOM6)
build.regressions: $(foreach b,symmetric target,build/$(b)/MOM6)

# Executable
BUILD_TARGETS = MOM6 Makefile path_names
.PRECIOUS: $(foreach b,$(BUILDS),$(foreach f,$(BUILD_TARGETS),$(BUILD)/$(b)/$(f)))
.PRECIOUS: $(foreach b,$(BUILDS),$(foreach f,$(BUILD_TARGETS),build/$(b)/$(f)))

# Conditionally build symmetric with coverage support
COVFLAG=$(if $(REPORT_COVERAGE),COVERAGE=1,)

$(BUILD)/target/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1
$(BUILD)/symmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 $(COVFLAG)
$(BUILD)/asymmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1
$(BUILD)/repro/MOM6: MOMFLAGS=NETCDF=3 REPRO=1
$(BUILD)/openmp/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 OPENMP=1
build/target/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 INIT=1
build/symmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 INIT=1 $(COVFLAG)
build/asymmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 INIT=1
build/repro/MOM6: MOMFLAGS=NETCDF=3 REPRO=1
build/openmp/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 OPENMP=1 INIT=1

$(BUILD)/asymmetric/path_names: GRID_SRC=config_src/dynamic
$(BUILD)/%/path_names: GRID_SRC=config_src/dynamic_symmetric
build/asymmetric/path_names: GRID_SRC=config_src/dynamic
build/%/path_names: GRID_SRC=config_src/dynamic_symmetric

$(BUILD)/%/MOM6: $(BUILD)/%/Makefile $(FMS)/lib/libfms.a
build/%/MOM6: build/%/Makefile $(FMS)/lib/libfms.a
make -C $(@D) $(MOMFLAGS) $(@F)

$(BUILD)/%/Makefile: $(BUILD)/%/path_names
build/%/Makefile: build/%/path_names
cp $(MKMF_TEMPLATE) $(@D)
cd $(@D) && $(MKMF) \
-t $(notdir $(MKMF_TEMPLATE)) \
-o '-I $(FMS)/build' \
-o '-I ../../$(DEPS)/fms/build' \
-p MOM6 \
-l '$(FMS)/lib/libfms.a' \
-l '../../$(DEPS)/fms/lib/libfms.a' \
-c $(MKMF_CPP) \
path_names

# NOTE: These path_names rules could be merged

$(BUILD)/target/path_names: $(LIST_PATHS) $(TARGET_CODEBASE)
build/target/path_names: $(LIST_PATHS) $(TARGET_CODEBASE) $(TARGET_SOURCE)
mkdir -p $(@D)
cd $(@D) && $(LIST_PATHS) -l \
$(TARGET_CODEBASE)/src \
$(TARGET_CODEBASE)/config_src/solo_driver \
$(TARGET_CODEBASE)/$(GRID_SRC)
../../$(TARGET_CODEBASE)/src \
../../$(TARGET_CODEBASE)/config_src/solo_driver \
../../$(TARGET_CODEBASE)/$(GRID_SRC)

$(BUILD)/%/path_names: $(LIST_PATHS) $(SOURCE)
build/%/path_names: $(LIST_PATHS) $(MOM_SOURCE)
mkdir -p $(@D)
cd $(@D) && $(LIST_PATHS) -l \
$(BASE)/src \
$(BASE)/config_src/solo_driver \
$(BASE)/$(GRID_SRC)
../../../src \
../../../config_src/solo_driver \
../../../$(GRID_SRC)

# Target repository for regression tests
$(TARGET_CODEBASE):
Expand All @@ -154,7 +161,7 @@ $(FMS)/build/Makefile: $(FMS)/build/path_names
-c $(MKMF_CPP) \
path_names

$(FMS)/build/path_names: $(FMS)/src $(FMS_FILES) $(LIST_PATHS)
$(FMS)/build/path_names: $(LIST_PATHS) $(FMS)/src $(FMS_SOURCE)
mkdir -p $(@D)
cd $(@D) && $(LIST_PATHS) -l ../src

Expand Down Expand Up @@ -247,8 +254,8 @@ endif
# $(5): Environment variables
# $(6): Number of MPI ranks
define STAT_RULE
results/%/ocean.stats.$(1): ../build/$(2)/MOM6
if [ $(3) ]; then find ../build/$(2) -name *.gcda -exec rm -f '{}' \; ; fi
results/%/ocean.stats.$(1): build/$(2)/MOM6
if [ $(3) ]; then find build/$(2) -name *.gcda -exec rm -f '{}' \; ; fi
mkdir -p work/$$*/$(1)
cp -rL $$*/* work/$$*/$(1)
cd work/$$*/$(1) && if [ -f Makefile ]; then make; fi
Expand Down Expand Up @@ -282,7 +289,7 @@ $(eval $(call STAT_RULE,dim.h,symmetric,,H_RESCALE_POWER=11,,1))
$(eval $(call STAT_RULE,dim.z,symmetric,,Z_RESCALE_POWER=11,,1))

# Restart tests require significant preprocessing, and are handled separately.
results/%/ocean.stats.restart: ../build/symmetric/MOM6
results/%/ocean.stats.restart: build/symmetric/MOM6
rm -rf work/$*/restart
mkdir -p work/$*/restart
cp -rL $*/* work/$*/restart
Expand Down Expand Up @@ -321,7 +328,7 @@ results/%/ocean.stats.restart: ../build/symmetric/MOM6
clean: clean.stats
@# Assert that we are in .testing for recursive delete
@[ $$(basename $$(pwd)) = .testing ]
rm -rf ../build
rm -rf build

.PHONY: clean.stats
clean.stats:
Expand Down
8 changes: 7 additions & 1 deletion .testing/linux-ubuntu-xenial-gnu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LD = mpif90 $(MAIN_PROGRAM)
DEBUG = # If non-blank, perform a debug build (Cannot be
# mixed with REPRO or TEST)

REPRO = # If non-blank, erform a build that guarentees
REPRO = # If non-blank, perform a build that guarentees
# reprodicuibilty from run to run. Cannot be used
# with DEBUG or TEST

Expand Down Expand Up @@ -54,6 +54,8 @@ SSE = # The SSE options to be used to compile. If blank,

COVERAGE = # Add the code coverage compile options.

INIT = # Enable aggressive initialization

# Need to use at least GNU Make version 3.81
need := 3.81
ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
Expand Down Expand Up @@ -89,6 +91,10 @@ FFLAGS := -fcray-pointer -fdefault-double-8 -fdefault-real-8 -Waliasing -ffree-l
FFLAGS_OPT = -O3
FFLAGS_REPRO = -O2 -fbounds-check
FFLAGS_DEBUG = -O0 -g -W -Wno-compare-reals -fbounds-check -fbacktrace -ffpe-trap=invalid,zero,overflow
# Enable aggressive initialization
ifdef INIT
FFLAGS_DEBUG += -finit-real=snan -finit-integer=2147483647 -finit-derived
endif

# Flags to add additional build options
FFLAGS_OPENMP = -fopenmp
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# This is a not a c-language project but we use the same environment.
language: c
dist: xenial
dist: bionic

# --depth flag is breaking our merge, try disabling it
# NOTE: We may be able to go back to depth=50 in production
Expand Down
18 changes: 9 additions & 9 deletions config_src/coupled_driver/MOM_surface_forcing_gfdl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
isr = is-isd+1 ; ier = ie-isd+1 ; jsr = js-jsd+1 ; jer = je-jsd+1

kg_m2_s_conversion = US%kg_m3_to_R*US%m_to_Z*US%T_to_s
kg_m2_s_conversion = US%kg_m2s_to_RZ_T
if (CS%restore_temp) rhoXcp = CS%Rho0 * fluxes%C_p
open_ocn_mask(:,:) = 1.0
pme_adj(:,:) = 0.0
Expand Down Expand Up @@ -370,10 +370,10 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
if (CS%adjust_net_srestore_to_zero) then
if (CS%adjust_net_srestore_by_scaling) then
call adjust_area_mean_to_zero(fluxes%salt_flux, G, fluxes%saltFluxGlobalScl, &
unit_scale=US%R_to_kg_m3*US%Z_to_m*US%s_to_T)
unit_scale=US%RZ_T_to_kg_m2s)
fluxes%saltFluxGlobalAdj = 0.
else
work_sum(is:ie,js:je) = US%L_to_m**2*US%R_to_kg_m3*US%Z_to_m*US%s_to_T * &
work_sum(is:ie,js:je) = US%L_to_m**2*US%RZ_T_to_kg_m2s * &
G%areaT(is:ie,js:je)*fluxes%salt_flux(is:ie,js:je)
fluxes%saltFluxGlobalAdj = reproducing_sum(work_sum(:,:), isr,ier, jsr,jer)/CS%area_surf
fluxes%salt_flux(is:ie,js:je) = fluxes%salt_flux(is:ie,js:je) - kg_m2_s_conversion * fluxes%saltFluxGlobalAdj
Expand All @@ -393,11 +393,11 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
if (CS%adjust_net_srestore_to_zero) then
if (CS%adjust_net_srestore_by_scaling) then
call adjust_area_mean_to_zero(fluxes%vprec, G, fluxes%vPrecGlobalScl, &
unit_scale=US%R_to_kg_m3*US%Z_to_m*US%s_to_T)
unit_scale=US%RZ_T_to_kg_m2s)
fluxes%vPrecGlobalAdj = 0.
else
work_sum(is:ie,js:je) = US%L_to_m**2*G%areaT(is:ie,js:je) * &
US%R_to_kg_m3*US%Z_to_m*US%s_to_T*fluxes%vprec(is:ie,js:je)
US%RZ_T_to_kg_m2s*fluxes%vprec(is:ie,js:je)
fluxes%vPrecGlobalAdj = reproducing_sum(work_sum(:,:), isr, ier, jsr, jer) / CS%area_surf
do j=js,je ; do i=is,ie
fluxes%vprec(i,j) = ( fluxes%vprec(i,j) - kg_m2_s_conversion*fluxes%vPrecGlobalAdj ) * G%mask2dT(i,j)
Expand Down Expand Up @@ -589,7 +589,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
sign_for_net_FW_bug = 1.
if (CS%use_net_FW_adjustment_sign_bug) sign_for_net_FW_bug = -1.
do j=js,je ; do i=is,ie
net_FW(i,j) = US%R_to_kg_m3*US%Z_to_m*US%s_to_T* &
net_FW(i,j) = US%RZ_T_to_kg_m2s* &
(((fluxes%lprec(i,j) + fluxes%fprec(i,j)) + &
(fluxes%lrunoff(i,j) + fluxes%frunoff(i,j))) + &
(fluxes%evap(i,j) + fluxes%vprec(i,j)) ) * US%L_to_m**2*G%areaT(i,j)
Expand All @@ -608,7 +608,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
if (CS%adjust_net_fresh_water_by_scaling) then
call adjust_area_mean_to_zero(net_FW2, G, fluxes%netFWGlobalScl)
do j=js,je ; do i=is,ie
fluxes%vprec(i,j) = fluxes%vprec(i,j) + US%kg_m3_to_R*US%m_to_Z*US%T_to_s * &
fluxes%vprec(i,j) = fluxes%vprec(i,j) + US%kg_m2s_to_RZ_T * &
(net_FW2(i,j) - net_FW(i,j)/(US%L_to_m**2*G%areaT(i,j))) * G%mask2dT(i,j)
enddo ; enddo
else
Expand Down Expand Up @@ -1138,15 +1138,15 @@ subroutine apply_flux_adjustments(G, US, CS, Time, fluxes)

if (overrode_h) then ; do j=jsc,jec ; do i=isc,iec
fluxes%salt_flux_added(i,j) = fluxes%salt_flux_added(i,j) + &
US%kg_m3_to_R*US%m_to_Z*US%T_to_s * temp_at_h(i,j)* G%mask2dT(i,j)
US%kg_m2s_to_RZ_T * temp_at_h(i,j)* G%mask2dT(i,j)
enddo ; enddo ; endif
! Not needed? ! if (overrode_h) call pass_var(fluxes%salt_flux_added, G%Domain)

overrode_h = .false.
call data_override('OCN', 'prcme_adj', temp_at_h(isc:iec,jsc:jec), Time, override=overrode_h)

if (overrode_h) then ; do j=jsc,jec ; do i=isc,iec
fluxes%vprec(i,j) = fluxes%vprec(i,j) + US%kg_m3_to_R*US%m_to_Z*US%T_to_s * temp_at_h(i,j)* G%mask2dT(i,j)
fluxes%vprec(i,j) = fluxes%vprec(i,j) + US%kg_m2s_to_RZ_T * temp_at_h(i,j)* G%mask2dT(i,j)
enddo ; enddo ; endif
! Not needed? ! if (overrode_h) call pass_var(fluxes%vprec, G%Domain)
end subroutine apply_flux_adjustments
Expand Down
10 changes: 5 additions & 5 deletions config_src/ice_solo_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ subroutine buoyancy_forcing_from_files(sfc_state, fluxes, day, dt, G, US, CS)
do j=js,je ; do i=is,ie ; fluxes%LW(i,j) = fluxes%LW(i,j) - temp(i,j) ; enddo ; enddo

call MOM_read_data(trim(CS%inputdir)//trim(CS%evaporation_file), "evap", &
fluxes%evap(:,:), G%Domain, timelevel=time_lev, scale=-US%kg_m3_to_R*US%m_to_Z*US%T_to_s)
fluxes%evap(:,:), G%Domain, timelevel=time_lev, scale=-US%kg_m2s_to_RZ_T)
do j=js,je ; do i=is,ie
fluxes%latent(i,j) = CS%latent_heat_vapor*fluxes%evap(i,j)
fluxes%latent_evap_diag(i,j) = fluxes%latent(i,j)
Expand All @@ -705,20 +705,20 @@ subroutine buoyancy_forcing_from_files(sfc_state, fluxes, day, dt, G, US, CS)
enddo ; enddo

call MOM_read_data(trim(CS%inputdir)//trim(CS%snow_file), "snow", &
fluxes%fprec(:,:), G%Domain, timelevel=time_lev, scale=US%kg_m3_to_R*US%m_to_Z*US%T_to_s)
fluxes%fprec(:,:), G%Domain, timelevel=time_lev, scale=US%kg_m2s_to_RZ_T)
call MOM_read_data(trim(CS%inputdir)//trim(CS%precip_file), "precip", &
fluxes%lprec(:,:), G%Domain, timelevel=time_lev, scale=US%kg_m3_to_R*US%m_to_Z*US%T_to_s)
fluxes%lprec(:,:), G%Domain, timelevel=time_lev, scale=US%kg_m2s_to_RZ_T)
do j=js,je ; do i=is,ie
fluxes%lprec(i,j) = fluxes%lprec(i,j) - fluxes%fprec(i,j)
enddo ; enddo

call MOM_read_data(trim(CS%inputdir)//trim(CS%freshdischarge_file), "disch_w", &
temp(:,:), G%Domain, timelevel=time_lev_monthly, scale=US%kg_m3_to_R*US%m_to_Z*US%T_to_s)
temp(:,:), G%Domain, timelevel=time_lev_monthly, scale=US%kg_m2s_to_RZ_T)
do j=js,je ; do i=is,ie
fluxes%lrunoff(i,j) = temp(i,j)*US%m_to_L**2*G%IareaT(i,j)
enddo ; enddo
call MOM_read_data(trim(CS%inputdir)//trim(CS%freshdischarge_file), "disch_s", &
temp(:,:), G%Domain, timelevel=time_lev_monthly, scale=US%kg_m3_to_R*US%m_to_Z*US%T_to_s)
temp(:,:), G%Domain, timelevel=time_lev_monthly, scale=US%kg_m2s_to_RZ_T)
do j=js,je ; do i=is,ie
fluxes%frunoff(i,j) = temp(i,j)*US%m_to_L**2*G%IareaT(i,j)
enddo ; enddo
Expand Down
16 changes: 8 additions & 8 deletions config_src/mct_driver/mom_surface_forcing_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
isr = is-isd+1 ; ier = ie-isd+1 ; jsr = js-jsd+1 ; jer = je-jsd+1

kg_m2_s_conversion = US%kg_m3_to_R*US%m_to_Z*US%T_to_s
kg_m2_s_conversion = US%kg_m2s_to_RZ_T
C_p = US%Q_to_J_kg*fluxes%C_p
open_ocn_mask(:,:) = 1.0
pme_adj(:,:) = 0.0
Expand Down Expand Up @@ -372,10 +372,10 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
if (CS%adjust_net_srestore_to_zero) then
if (CS%adjust_net_srestore_by_scaling) then
call adjust_area_mean_to_zero(fluxes%salt_flux, G, fluxes%saltFluxGlobalScl, &
unit_scale=US%R_to_kg_m3*US%Z_to_m*US%s_to_T)
unit_scale=US%RZ_T_to_kg_m2s)
fluxes%saltFluxGlobalAdj = 0.
else
work_sum(is:ie,js:je) = US%L_to_m**2*US%R_to_kg_m3*US%Z_to_m*US%s_to_T * &
work_sum(is:ie,js:je) = US%L_to_m**2*US%RZ_T_to_kg_m2s * &
G%areaT(is:ie,js:je)*fluxes%salt_flux(is:ie,js:je)
fluxes%saltFluxGlobalAdj = reproducing_sum(work_sum(:,:), isr,ier, jsr,jer)/CS%area_surf
fluxes%salt_flux(is:ie,js:je) = fluxes%salt_flux(is:ie,js:je) - kg_m2_s_conversion * fluxes%saltFluxGlobalAdj
Expand All @@ -395,11 +395,11 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
if (CS%adjust_net_srestore_to_zero) then
if (CS%adjust_net_srestore_by_scaling) then
call adjust_area_mean_to_zero(fluxes%vprec, G, fluxes%vPrecGlobalScl, &
unit_scale=US%R_to_kg_m3*US%Z_to_m*US%s_to_T)
unit_scale=US%RZ_T_to_kg_m2s)
fluxes%vPrecGlobalAdj = 0.
else
work_sum(is:ie,js:je) = US%L_to_m**2*G%areaT(is:ie,js:je) * &
US%R_to_kg_m3*US%Z_to_m*US%s_to_T*fluxes%vprec(is:ie,js:je)
US%RZ_T_to_kg_m2s*fluxes%vprec(is:ie,js:je)
fluxes%vPrecGlobalAdj = reproducing_sum(work_sum(:,:), isr, ier, jsr, jer) / CS%area_surf
do j=js,je ; do i=is,ie
fluxes%vprec(i,j) = ( fluxes%vprec(i,j) - kg_m2_s_conversion*fluxes%vPrecGlobalAdj ) * G%mask2dT(i,j)
Expand Down Expand Up @@ -551,7 +551,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
sign_for_net_FW_bug = 1.
if (CS%use_net_FW_adjustment_sign_bug) sign_for_net_FW_bug = -1.
do j=js,je ; do i=is,ie
net_FW(i,j) = US%R_to_kg_m3*US%Z_to_m*US%s_to_T * &
net_FW(i,j) = US%RZ_T_to_kg_m2s * &
(((fluxes%lprec(i,j) + fluxes%fprec(i,j) + fluxes%seaice_melt(i,j)) + &
(fluxes%lrunoff(i,j) + fluxes%frunoff(i,j))) + &
(fluxes%evap(i,j) + fluxes%vprec(i,j)) ) * US%L_to_m**2*G%areaT(i,j)
Expand Down Expand Up @@ -912,15 +912,15 @@ subroutine apply_flux_adjustments(G, US, CS, Time, fluxes)

if (overrode_h) then ; do j=jsc,jec ; do i=isc,iec
fluxes%salt_flux_added(i,j) = fluxes%salt_flux_added(i,j) + &
US%kg_m3_to_R*US%m_to_Z*US%T_to_s * temp_at_h(i,j)* G%mask2dT(i,j)
US%kg_m2s_to_RZ_T * temp_at_h(i,j)* G%mask2dT(i,j)
enddo ; enddo ; endif
! Not needed? ! if (overrode_h) call pass_var(fluxes%salt_flux_added, G%Domain)

overrode_h = .false.
call data_override('OCN', 'prcme_adj', temp_at_h(isc:iec,jsc:jec), Time, override=overrode_h)

if (overrode_h) then ; do j=jsc,jec ; do i=isc,iec
fluxes%vprec(i,j) = fluxes%vprec(i,j) + US%kg_m3_to_R*US%m_to_Z*US%T_to_s * temp_at_h(i,j)* G%mask2dT(i,j)
fluxes%vprec(i,j) = fluxes%vprec(i,j) + US%kg_m2s_to_RZ_T * temp_at_h(i,j)* G%mask2dT(i,j)
enddo ; enddo ; endif
! Not needed? ! if (overrode_h) call pass_var(fluxes%vprec, G%Domain)

Expand Down
Loading

0 comments on commit 8d7be68

Please sign in to comment.