Skip to content

Commit

Permalink
Merge pull request mom-ocean#41 from gustavo-marques/merge_dev_master…
Browse files Browse the repository at this point in the history
…_20feb2018

Merge dev/master 20 feb. 2018
  • Loading branch information
alperaltuntas committed Feb 21, 2018
2 parents 524b78c + e2c2909 commit 2f79ffc
Show file tree
Hide file tree
Showing 104 changed files with 7,574 additions and 6,225 deletions.
15 changes: 12 additions & 3 deletions config_src/coupled_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module MOM_surface_forcing
logical :: adjust_net_srestore_to_zero ! adjust srestore to zero (for both salt_flux or vprec)
logical :: adjust_net_srestore_by_scaling ! adjust srestore w/o moving zero contour
logical :: adjust_net_fresh_water_to_zero ! adjust net surface fresh-water (w/ restoring) to zero
logical :: use_net_FW_adjustment_sign_bug ! use the wrong sign when adjusting net FW
logical :: adjust_net_fresh_water_by_scaling ! adjust net surface fresh-water w/o moving zero contour
logical :: mask_srestore_under_ice ! If true, use an ice mask defined by frazil
! criteria for salinity restoring.
Expand Down Expand Up @@ -268,6 +269,7 @@ subroutine convert_IOB_to_fluxes(IOB, forces, fluxes, index_bounds, Time, G, CS,
real :: delta_sst ! temporary storage for sst diff from restoring value

real :: C_p ! heat capacity of seawater ( J/(K kg) )
real :: sign_for_net_FW_bug ! Should be +1. but an old bug can be recovered by using -1.

call cpu_clock_begin(id_clock_forcing)

Expand Down Expand Up @@ -549,6 +551,8 @@ subroutine convert_IOB_to_fluxes(IOB, forces, fluxes, index_bounds, Time, G, CS,

! adjust the NET fresh-water flux to zero, if flagged
if (CS%adjust_net_fresh_water_to_zero) then
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) = (((fluxes%lprec(i,j) + fluxes%fprec(i,j)) + &
(fluxes%lrunoff(i,j) + fluxes%frunoff(i,j))) + &
Expand All @@ -560,15 +564,15 @@ subroutine convert_IOB_to_fluxes(IOB, forces, fluxes, index_bounds, Time, G, CS,
! is constant.
! To do this correctly we will need a sea-ice melt field added to IOB. -AJA
if (ASSOCIATED(IOB%salt_flux) .and. (CS%ice_salt_concentration>0.0)) &
net_FW(i,j) = net_FW(i,j) - G%areaT(i,j) * &
net_FW(i,j) = net_FW(i,j) + sign_for_net_FW_bug * G%areaT(i,j) * &
(IOB%salt_flux(i-i0,j-j0) / CS%ice_salt_concentration)
net_FW2(i,j) = net_FW(i,j)
net_FW2(i,j) = net_FW(i,j) / G%areaT(i,j)
enddo ; enddo

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) + (net_FW2(i,j) - net_FW(i,j)) * G%mask2dT(i,j)
fluxes%vprec(i,j) = fluxes%vprec(i,j) + (net_FW2(i,j) - net_FW(i,j)/G%areaT(i,j)) * G%mask2dT(i,j)
enddo; enddo
else
fluxes%netFWGlobalAdj = reproducing_sum(net_FW(:,:), isr, ier, jsr, jer) / CS%area_surf
Expand Down Expand Up @@ -930,6 +934,11 @@ subroutine surface_forcing_init(Time, G, param_file, diag, CS, restore_salt, res
CS%adjust_net_fresh_water_to_zero, &
"If true, adjusts the net fresh-water forcing seen \n"//&
"by the ocean (including restoring) to zero.", default=.false.)
if (CS%adjust_net_fresh_water_to_zero) &
call get_param(param_file, mdl, "USE_NET_FW_ADJUSTMENT_SIGN_BUG", &
CS%use_net_FW_adjustment_sign_bug, &
"If true, use the wrong sign for the adjustment to\n"//&
"the net fresh-water.", default=.true.)
call get_param(param_file, mdl, "ADJUST_NET_FRESH_WATER_BY_SCALING", &
CS%adjust_net_fresh_water_by_scaling, &
"If true, adjustments to net fresh water to achieve zero net are\n"//&
Expand Down
306 changes: 119 additions & 187 deletions config_src/coupled_driver/ocean_model_MOM.F90

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions config_src/ice_solo_driver/ice_shelf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,14 @@ program SHELF_main
call log_param(param_file, mdl, "ELAPSED TIME AS MASTER", elapsed_time_master)

! i don't think we'll use this...
! call MOM_sum_output_init(grid, param_file, dirs%output_directory, &
! MOM_CSp%ntrunc, Start_time, sum_output_CSp)
call MOM_write_cputime_init(param_file, dirs%output_directory, Start_time, &
write_CPU_CSp)
call MOM_mesg("Done MOM_write_cputime_init.", 5)


! Close the param_file. No further parsing of input is possible after this.
call close_param_file(param_file)
call diag_mediator_close_registration(MOM_CSp%diag)
! call diag_mediator_close_registration(diag)

! Write out a time stamp file.
call open_file(unit, 'time_stamp.out', form=ASCII_FILE, action=APPEND_FILE, &
Expand Down
210 changes: 94 additions & 116 deletions config_src/mct_driver/ocn_comp_mct.F90

Large diffs are not rendered by default.

148 changes: 71 additions & 77 deletions config_src/solo_driver/MOM_driver.F90

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion config_src/solo_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ module MOM_surface_forcing
use SCM_CVmix_tests, only : SCM_CVmix_tests_CS
use BFB_surface_forcing, only : BFB_buoyancy_forcing
use BFB_surface_forcing, only : BFB_surface_forcing_init, BFB_surface_forcing_CS

use dumbbell_surface_forcing, only : dumbbell_surface_forcing_init, dumbbell_surface_forcing_CS
use dumbbell_surface_forcing, only : dumbbell_buoyancy_forcing
use data_override_mod, only : data_override_init, data_override

implicit none ; private
Expand Down Expand Up @@ -202,6 +203,7 @@ module MOM_surface_forcing
type(user_revise_forcing_CS), pointer :: urf_CS => NULL()
type(user_surface_forcing_CS), pointer :: user_forcing_CSp => NULL()
type(BFB_surface_forcing_CS), pointer :: BFB_forcing_CSp => NULL()
type(dumbbell_surface_forcing_CS), pointer :: dumbbell_forcing_CSp => NULL()
type(MESO_surface_forcing_CS), pointer :: MESO_forcing_CSp => NULL()
type(Neverland_surface_forcing_CS), pointer :: Neverland_forcing_CSp => NULL()
type(SCM_idealized_hurricane_CS), pointer :: SCM_idealized_hurricane_CSp => NULL()
Expand Down Expand Up @@ -328,6 +330,8 @@ subroutine set_forcing(sfc_state, forces, fluxes, day_start, day_interval, G, CS
call USER_buoyancy_forcing(sfc_state, fluxes, day_center, dt, G, CS%user_forcing_CSp)
elseif (trim(CS%buoy_config) == "BFB") then
call BFB_buoyancy_forcing(sfc_state, fluxes, day_center, dt, G, CS%BFB_forcing_CSp)
elseif (trim(CS%buoy_config) == "dumbbell") then
call dumbbell_buoyancy_forcing(sfc_state, fluxes, day_center, dt, G, CS%dumbbell_forcing_CSp)
elseif (trim(CS%buoy_config) == "NONE") then
call MOM_mesg("MOM_surface_forcing: buoyancy forcing has been set to omitted.")
elseif (CS%variable_buoyforce .and. .not.CS%first_call_set_forcing) then
Expand Down Expand Up @@ -1801,6 +1805,8 @@ subroutine surface_forcing_init(Time, G, param_file, diag, CS, tracer_flow_CSp)
call USER_surface_forcing_init(Time, G, param_file, diag, CS%user_forcing_CSp)
elseif (trim(CS%buoy_config) == "BFB" ) then
call BFB_surface_forcing_init(Time, G, param_file, diag, CS%BFB_forcing_CSp)
elseif (trim(CS%buoy_config) == "dumbbell" ) then
call dumbbell_surface_forcing_init(Time, G, param_file, diag, CS%dumbbell_forcing_CSp)
elseif (trim(CS%wind_config) == "MESO" .or. trim(CS%buoy_config) == "MESO" ) then
call MESO_surface_forcing_init(Time, G, param_file, diag, CS%MESO_forcing_CSp)
elseif (trim(CS%wind_config) == "Neverland") then
Expand Down
Loading

0 comments on commit 2f79ffc

Please sign in to comment.