Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into fix_pb_bug_1
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallward authored Oct 11, 2024
2 parents 889d640 + f90b071 commit 84f8858
Show file tree
Hide file tree
Showing 9 changed files with 868 additions and 255 deletions.
2 changes: 1 addition & 1 deletion .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ $(BUILD)/%/MOM6: $(BUILD)/%/Makefile FORCE

# Target codebase should use its own build system
$(BUILD)/target/MOM6: $(BUILD)/target FORCE | $(TARGET_CODEBASE)
$(MAKE) -C $(TARGET_CODEBASE)/.testing build/symmetric/MOM6
$(MAKE) -C $(TARGET_CODEBASE)/.testing BUILD=build build/symmetric/MOM6

$(BUILD)/target: | $(TARGET_CODEBASE)
ln -s $(abspath $(TARGET_CODEBASE))/.testing/build/symmetric $@
Expand Down
5 changes: 5 additions & 0 deletions config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2371,6 +2371,11 @@ subroutine SetScalarField(field, rc)
ungriddedLBound=(/1/), ungriddedUBound=(/scalar_field_count/), gridToFieldMap=(/2/), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! initialize fldptr to zero
call ESMF_FieldGet(field, farrayPtr=fldptr2d, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
fldptr2d(:,:) = 0.0

end subroutine SetScalarField

end subroutine MOM_RealizeFields
Expand Down
4 changes: 2 additions & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2706,7 +2706,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
CS%tv%T => CS%T ; CS%tv%S => CS%S
if (CS%tv%T_is_conT) then
vd_T = var_desc(name="contemp", units="Celsius", longname="Conservative Temperature", &
cmor_field_name="thetao", cmor_longname="Sea Water Potential Temperature", &
cmor_field_name="bigthetao", cmor_longname="Sea Water Conservative Temperature", &
conversion=US%Q_to_J_kg*CS%tv%C_p)
else
vd_T = var_desc(name="temp", units="degC", longname="Potential Temperature", &
Expand All @@ -2715,7 +2715,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
endif
if (CS%tv%S_is_absS) then
vd_S = var_desc(name="abssalt", units="g kg-1", longname="Absolute Salinity", &
cmor_field_name="so", cmor_longname="Sea Water Salinity", &
cmor_field_name="absso", cmor_longname="Sea Water Absolute Salinity", &
conversion=0.001*US%S_to_ppt)
else
vd_S = var_desc(name="salt", units="psu", longname="Salinity", &
Expand Down
24 changes: 15 additions & 9 deletions src/ice_shelf/MOM_ice_shelf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,11 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS)
I_au = 0.0 ; if (asu1 + asu2 > 0.0) I_au = 1.0 / (asu1 + asu2)
I_av = 0.0 ; if (asv1 + asv2 > 0.0) I_av = 1.0 / (asv1 + asv2)
if (allocated(sfc_state%taux_shelf) .and. allocated(sfc_state%tauy_shelf)) then
taux2 = (asu1 * sfc_state%taux_shelf(I-1,j)**2 + asu2 * sfc_state%taux_shelf(I,j)**2 ) * I_au
tauy2 = (asv1 * sfc_state%tauy_shelf(i,J-1)**2 + asv2 * sfc_state%tauy_shelf(i,J)**2 ) * I_av
taux2 = (((asu1 * (sfc_state%taux_shelf(I-1,j)**2)) + (asu2 * (sfc_state%taux_shelf(I,j)**2)) ) * I_au)
tauy2 = (((asv1 * (sfc_state%tauy_shelf(i,J-1)**2)) + (asv2 * (sfc_state%tauy_shelf(i,J)**2)) ) * I_av)
endif
u2_av = (asu1 * sfc_state%u(I-1,j)**2 + asu2 * sfc_state%u(I,j)**2) * I_au
v2_av = (asv1 * sfc_state%v(i,J-1)**2 + asu2 * sfc_state%v(i,J)**2) * I_av
u2_av = (((asu1 * (sfc_state%u(I-1,j)**2)) + (asu2 * sfc_state%u(I,j)**2)) * I_au)
v2_av = (((asv1 * (sfc_state%v(i,J-1)**2)) + (asu2 * sfc_state%v(i,J)**2)) * I_av)

if ((taux2 + tauy2 > 0.0) .and. .not.CS%ustar_shelf_from_vel) then
if (CS%ustar_max >= 0.0) then
Expand Down Expand Up @@ -824,7 +824,7 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS)
ISS%dhdt_shelf(i,j) = (ISS%h_shelf(i,j) - ISS%dhdt_shelf(i,j))*Itime_step
enddo; enddo

call IS_dynamics_post_data(time_step, Time, CS%dCS, G)
call IS_dynamics_post_data(time_step, Time, CS%dCS, ISS, G)
endif

if (CS%shelf_mass_is_dynamic) &
Expand Down Expand Up @@ -2603,7 +2603,7 @@ subroutine solo_step_ice_shelf(CS, time_interval, nsteps, Time, min_time_step_in
call process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Ifull_time_step, dh_adott, dh_adott*0.0)
call disable_averaging(CS%diag)

call IS_dynamics_post_data(full_time_step, Time, CS%dCS, G)
call IS_dynamics_post_data(full_time_step, Time, CS%dCS, ISS, G)
end subroutine solo_step_ice_shelf

!> Post_data calls for ice-sheet scalars
Expand Down Expand Up @@ -2648,7 +2648,9 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
endif
if (CS%id_f_adott > 0 .or. CS%id_f_adot > 0) then !floating only: surface accumulation - surface melt
call masked_var_grounded(G,CS%dCS,dh_adott,tmp)
tmp(:,:) = dh_adott(:,:) - tmp(:,:)
do j=js,je ; do i=is,ie
tmp(i,j) = dh_adott(i,j) - tmp(i,j)
enddo; enddo
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val)
if (CS%id_f_adott > 0) call post_scalar_data(CS%id_f_adott,val ,CS%diag)
if (CS%id_f_adot > 0) call post_scalar_data(CS%id_f_adot ,val*Itime_step,CS%diag)
Expand Down Expand Up @@ -2710,7 +2712,9 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
endif
if (CS%id_Ant_f_adott > 0 .or. CS%id_Ant_f_adot > 0) then !floating only: surface accumulation - surface melt
call masked_var_grounded(G,CS%dCS,dh_adott,tmp)
tmp(:,:) = dh_adott(:,:) - tmp(:,:)
do j=js,je ; do i=is,ie
tmp(i,j) = dh_adott(i,j) - tmp(i,j)
enddo; enddo
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=0)
if (CS%id_Ant_f_adott > 0) call post_scalar_data(CS%id_Ant_f_adott,val ,CS%diag)
if (CS%id_Ant_f_adot > 0) call post_scalar_data(CS%id_Ant_f_adot ,val*Itime_step,CS%diag)
Expand Down Expand Up @@ -2772,7 +2776,9 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
endif
if (CS%id_Gr_f_adott > 0 .or. CS%id_Gr_f_adot > 0) then !floating only: surface accumulation - surface melt
call masked_var_grounded(G,CS%dCS,dh_adott,tmp)
tmp(:,:) = dh_adott(:,:) - tmp(:,:)
do j=js,je ; do i=is,ie
tmp(i,j) = dh_adott(i,j) - tmp(i,j)
enddo; enddo
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=1)
if (CS%id_Gr_f_adott > 0) call post_scalar_data(CS%id_Gr_f_adott,val ,CS%diag)
if (CS%id_Gr_f_adot > 0) call post_scalar_data(CS%id_Gr_f_adot ,val*Itime_step,CS%diag)
Expand Down
Loading

0 comments on commit 84f8858

Please sign in to comment.