Skip to content

Commit

Permalink
Merge pull request #24 from NOAA-GFDL/dev/gfdl
Browse files Browse the repository at this point in the history
Merge in latest round of dev/gfdl updates
  • Loading branch information
wrongkindofdoctor authored Jul 29, 2019
2 parents aa11e1f + 5635eaf commit 5589d8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
endif
call register_tracer(CS%tv%T, CS%tracer_Reg, param_file, dG%HI, GV, &
tr_desc=vd_T, registry_diags=.true., flux_nameroot='T', &
flux_units='W m-2', flux_longname='Heat', &
flux_units='W', flux_longname='Heat', &
flux_scale=conv2watt, convergence_units='W m-2', &
convergence_scale=conv2watt, CMOR_tendprefix="opottemp", diag_form=2)
call register_tracer(CS%tv%S, CS%tracer_Reg, param_file, dG%HI, GV, &
Expand Down
4 changes: 2 additions & 2 deletions src/diagnostics/MOM_sum_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -818,15 +818,15 @@ subroutine write_energy(u, v, h, tv, day, n, G, GV, US, CS, tracer_CSp, OBC, dt_
endif

if (CS%use_temperature) then
write(CS%fileenergy_ascii,'(A,",",A,",", I6,", En ",ES18.12, &
write(CS%fileenergy_ascii,'(A,",",A,",", I6,", En ",ES22.16, &
&", CFL ", F8.5, ", SL ",&
&es11.4,", M ",ES11.5,", S",f8.4,", T",f8.4,&
&", Me ",ES9.2,", Se ",ES9.2,", Te ",ES9.2)') &
trim(n_str), trim(day_str), CS%ntrunc, En_mass, max_CFL(1), &
-H_0APE(1), mass_tot, salin, temp, mass_anom/mass_tot, salin_anom, &
temp_anom
else
write(CS%fileenergy_ascii,'(A,",",A,",", I6,", En ",ES18.12, &
write(CS%fileenergy_ascii,'(A,",",A,",", I6,", En ",ES22.16, &
&", CFL ", F8.5, ", SL ",&
&ES11.4,", Mass ",ES11.5,", Me ",ES9.2)') &
trim(n_str), trim(day_str), CS%ntrunc, En_mass, max_CFL(1), &
Expand Down
10 changes: 9 additions & 1 deletion src/framework/MOM_horizontal_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ subroutine horiz_interp_and_extrap_tracer_record(filename, varnam, conversion,
real, dimension(:), allocatable :: lat_inp, last_row
real :: max_lat, min_lat, pole, max_depth, npole
real :: roundoff ! The magnitude of roundoff, usually ~2e-16.
real :: add_offset, scale_factor
logical :: add_np
character(len=8) :: laynum
type(horiz_interp_type) :: Interp
Expand Down Expand Up @@ -376,6 +377,13 @@ subroutine horiz_interp_and_extrap_tracer_record(filename, varnam, conversion,
if (rcode /= 0) call MOM_error(FATAL,"error finding missing value for "//&
trim(varnam)//" in file "// trim(filename)//" in hinterp_extrap")

rcode = NF90_GET_ATT(ncid, varid, "add_offset", add_offset)
if (rcode /= 0) add_offset = 0.0

rcode = NF90_GET_ATT(ncid, varid, "scale_factor", scale_factor)
if (rcode /= 0) scale_factor = 1.0


if (allocated(lon_in)) deallocate(lon_in)
if (allocated(lat_in)) deallocate(lat_in)
if (allocated(z_in)) deallocate(z_in)
Expand Down Expand Up @@ -499,7 +507,7 @@ subroutine horiz_interp_and_extrap_tracer_record(filename, varnam, conversion,
do i=1,id
if (abs(tr_inp(i,j)-missing_value) > abs(roundoff*missing_value)) then
mask_in(i,j) = 1.0
tr_inp(i,j) = tr_inp(i,j) * conversion
tr_inp(i,j) = (tr_inp(i,j)*scale_factor+add_offset) * conversion
else
tr_inp(i,j) = missing_value
endif
Expand Down

0 comments on commit 5589d8c

Please sign in to comment.