Skip to content

Commit 4d8d2a7

Browse files
committed
Revise the ice_shelf dimensional rescaling
Refactored the volume_above_floatation, write_ice_shelf_energy and ice_shelf_solve_outer routines to work in rescaled units by making use of the unscale arguments to reproducing_sum(). Also added or corrected comments documenting the units of 11 real variables in these routines. The routine integrate_over_Ice_sheet_area was converted into a function and var_scale was renamed to unscale for more consistency with the rest of the MOM6 code. Additionally, add_shelf_flux and update_shelf_mass were modified to use the scale arguments to time_interp_external. A total of 12 rescaling variables were eliminated or moved into unscale arguments, and 2 blocks of code that scale input variables were eliminated. All answers and diagnostics are bitwise identical, and no interfaces are changed.
1 parent e6e0870 commit 4d8d2a7

File tree

2 files changed

+83
-85
lines changed

2 files changed

+83
-85
lines changed

src/ice_shelf/MOM_ice_shelf.F90

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -874,13 +874,15 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS)
874874

875875
end subroutine shelf_calc_flux
876876

877-
subroutine integrate_over_ice_sheet_area(G, ISS, var, var_scale, var_out, hemisphere)
877+
function integrate_over_ice_sheet_area(G, ISS, var, unscale, hemisphere) result(var_out)
878878
type(ocean_grid_type), intent(in) :: G !< The grid structure used by the ice shelf.
879879
type(ice_shelf_state), intent(in) :: ISS !< A structure with elements that describe the ice-shelf state
880880
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: var !< Ice variable to integrate in arbitrary units [A ~> a]
881-
real, intent(in) :: var_scale !< Dimensional scaling for variable to integrate [a A-1 ~> 1]
882-
real, intent(out) :: var_out !< Variable integrated over the area of the ice sheet in arbitrary units [a m2]
881+
real, intent(in) :: unscale !< Dimensional scaling for variable to integrate [a A-1 ~> 1]
883882
integer, optional, intent(in) :: hemisphere !< 0 for Antarctica only, 1 for Greenland only. Otherwise, all ice sheets
883+
real :: var_out !< Variable integrated over the area of the ice sheet in arbitrary unscaled units [a m2]
884+
885+
! Local variables
884886
integer :: IS_ID ! local copy of hemisphere
885887
real, dimension(SZI_(G),SZJ_(G)) :: var_cell !< Variable integrated over the ice-sheet area of each cell
886888
!! in arbitrary units [a m2]
@@ -903,16 +905,16 @@ subroutine integrate_over_ice_sheet_area(G, ISS, var, var_scale, var_out, hemisp
903905
if (ISS%hmask(i,j)>0 .and. G%geoLatT(i,j)>0.0) mask(i,j)=1
904906
enddo; enddo
905907
else !All ice sheets
906-
mask(G%isc:G%iec,G%jsc:G%jec)=ISS%hmask(G%isc:G%iec,G%jsc:G%jec)
908+
mask(G%isc:G%iec,G%jsc:G%jec) = ISS%hmask(G%isc:G%iec,G%jsc:G%jec)
907909
endif
908910

909911
var_cell(:,:)=0.0
910912
do j = G%jsc,G%jec; do i = G%isc,G%iec
911-
if (mask(i,j)>0) var_cell(i,j) = (var(i,j) * var_scale) * (ISS%area_shelf_h(i,j) * G%US%L_to_m**2)
913+
if (mask(i,j)>0) var_cell(i,j) = var(i,j) * ISS%area_shelf_h(i,j)
912914
enddo; enddo
913915

914-
var_out = reproducing_sum(var_cell)
915-
end subroutine integrate_over_ice_sheet_area
916+
var_out = unscale*G%US%L_to_m**2 * reproducing_sum(var_cell, unscale=unscale*G%US%L_to_m**2)
917+
end function integrate_over_ice_sheet_area
916918

917919
!> Converts the ice-shelf-to-ocean calving and calving_hflx variables from the ice-shelf state (ISS) type
918920
!! to the ocean public type
@@ -1252,10 +1254,8 @@ subroutine add_shelf_flux(G, US, CS, sfc_state, fluxes, time_step)
12521254
do j=js,je ; do i=is,ie
12531255
last_hmask(i,j) = ISS%hmask(i,j) ; last_area_shelf_h(i,j) = ISS%area_shelf_h(i,j)
12541256
enddo ; enddo
1255-
call time_interp_external(CS%mass_handle, Time0, last_mass_shelf)
1257+
call time_interp_external(CS%mass_handle, Time0, last_mass_shelf, scale=US%kg_m3_to_R*US%m_to_Z)
12561258
do j=js,je ; do i=is,ie
1257-
! This should only be done if time_interp_extern did an update.
1258-
last_mass_shelf(i,j) = US%kg_m3_to_R*US%m_to_Z * last_mass_shelf(i,j) ! Rescale after time_interp
12591259
last_h_shelf(i,j) = last_mass_shelf(i,j) / CS%density_ice
12601260
enddo ; enddo
12611261

@@ -2385,7 +2385,7 @@ subroutine update_shelf_mass(G, US, CS, ISS, Time)
23852385

23862386
! local variables
23872387
integer :: i, j, is, ie, js, je
2388-
real, allocatable, dimension(:,:) :: tmp2d ! Temporary array for storing ice shelf input data
2388+
real, allocatable, dimension(:,:) :: tmp2d ! Temporary array for storing ice shelf input data [R Z ~> kg m-2]
23892389

23902390
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
23912391

@@ -2396,15 +2396,10 @@ subroutine update_shelf_mass(G, US, CS, ISS, Time)
23962396
allocate(tmp2d(is:ie,js:je), source=0.0)
23972397
endif
23982398

2399-
call time_interp_external(CS%mass_handle, Time, tmp2d)
2399+
call time_interp_external(CS%mass_handle, Time, tmp2d, scale=US%kg_m3_to_R*US%m_to_Z)
24002400
call rotate_array(tmp2d, CS%turns, ISS%mass_shelf)
24012401
deallocate(tmp2d)
24022402

2403-
! This should only be done if time_interp_external did an update.
2404-
do j=js,je ; do i=is,ie
2405-
ISS%mass_shelf(i,j) = US%kg_m3_to_R*US%m_to_Z * ISS%mass_shelf(i,j) ! Rescale after time_interp
2406-
enddo ; enddo
2407-
24082403
do j=js,je ; do i=is,ie
24092404
ISS%area_shelf_h(i,j) = 0.0
24102405
ISS%hmask(i,j) = 0.
@@ -2618,6 +2613,7 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
26182613
real, dimension(SZI_(CS%grid),SZJ_(CS%grid)) :: dh_bdott !< Surface (plus basal if solo shelf mode)
26192614
!! melt/accumulation over a time step [Z ~> m]
26202615
real, dimension(SZI_(CS%grid),SZJ_(CS%grid)) :: tmp ! Temporary field used when calculating diagnostics [various]
2616+
real, dimension(SZI_(CS%grid),SZJ_(CS%grid)) :: ones ! Temporary field used when calculating diagnostics [various]
26212617
real :: vaf ! The current ice-sheet volume above floatation [m3]
26222618
real :: val ! Temporary value when calculating scalar diagnostics [various]
26232619
type(ocean_grid_type), pointer :: G => NULL() ! A pointer to the ocean's grid structure
@@ -2636,13 +2632,13 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
26362632
if (CS%id_vaf > 0) call post_scalar_data(CS%id_vaf ,vaf ,CS%diag) !current vaf
26372633
if (CS%id_dvafdt > 0) call post_scalar_data(CS%id_dvafdt,(vaf-vaf0)*Itime_step,CS%diag) !d(vaf)/dt
26382634
if (CS%id_adott > 0 .or. CS%id_adot > 0) then !surface accumulation - surface melt
2639-
call integrate_over_ice_sheet_area(G, ISS, dh_adott, US%Z_to_m, val)
2635+
val = integrate_over_ice_sheet_area(G, ISS, dh_adott, unscale=US%Z_to_m)
26402636
if (CS%id_adott > 0) call post_scalar_data(CS%id_adott,val ,CS%diag)
26412637
if (CS%id_adot > 0) call post_scalar_data(CS%id_adot ,val*Itime_step,CS%diag)
26422638
endif
26432639
if (CS%id_g_adott > 0 .or. CS%id_g_adot > 0) then !grounded only: surface accumulation - surface melt
26442640
call masked_var_grounded(G,CS%dCS,dh_adott,tmp)
2645-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val)
2641+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m)
26462642
if (CS%id_g_adott > 0) call post_scalar_data(CS%id_g_adott,val ,CS%diag)
26472643
if (CS%id_g_adot > 0) call post_scalar_data(CS%id_g_adot ,val*Itime_step,CS%diag)
26482644
endif
@@ -2651,12 +2647,12 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
26512647
do j=js,je ; do i=is,ie
26522648
tmp(i,j) = dh_adott(i,j) - tmp(i,j)
26532649
enddo; enddo
2654-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val)
2650+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m)
26552651
if (CS%id_f_adott > 0) call post_scalar_data(CS%id_f_adott,val ,CS%diag)
26562652
if (CS%id_f_adot > 0) call post_scalar_data(CS%id_f_adot ,val*Itime_step,CS%diag)
26572653
endif
26582654
if (CS%id_bdott > 0 .or. CS%id_bdot > 0) then !bottom accumulation - bottom melt
2659-
call integrate_over_ice_sheet_area(G, ISS, dh_bdott, US%Z_to_m, val)
2655+
val = integrate_over_ice_sheet_area(G, ISS, dh_bdott, unscale=US%Z_to_m)
26602656
if (CS%id_bdott > 0) call post_scalar_data(CS%id_bdott,val ,CS%diag)
26612657
if (CS%id_bdot > 0) call post_scalar_data(CS%id_bdot ,val*Itime_step,CS%diag)
26622658
endif
@@ -2665,7 +2661,7 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
26652661
do j=js,je ; do i=is,ie
26662662
if (dh_bdott(i,j) < 0) tmp(i,j) = -dh_bdott(i,j)
26672663
enddo; enddo
2668-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val)
2664+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m)
26692665
if (CS%id_bdott_melt > 0) call post_scalar_data(CS%id_bdott_melt,val ,CS%diag)
26702666
if (CS%id_bdot_melt > 0) call post_scalar_data(CS%id_bdot_melt ,val*Itime_step,CS%diag)
26712667
endif
@@ -2674,22 +2670,22 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
26742670
do j=js,je ; do i=is,ie
26752671
if (dh_bdott(i,j) > 0) tmp(i,j) = dh_bdott(i,j)
26762672
enddo; enddo
2677-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val)
2673+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m)
26782674
if (CS%id_bdott_accum > 0) call post_scalar_data(CS%id_bdott_accum,val ,CS%diag)
26792675
if (CS%id_bdot_accum > 0) call post_scalar_data(CS%id_bdot_accum ,val*Itime_step,CS%diag)
26802676
endif
26812677
if (CS%id_t_area > 0) then !ice sheet area
2682-
tmp(:,:) = 1.0; call integrate_over_ice_sheet_area(G, ISS, tmp, 1.0, val)
2678+
tmp(:,:) = 1.0 ; val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=1.0)
26832679
call post_scalar_data(CS%id_t_area,val,CS%diag)
26842680
endif
26852681
if (CS%id_g_area > 0 .or. CS%id_f_area > 0) then
2686-
tmp(:,:) = 1.0; call masked_var_grounded(G,CS%dCS,tmp,tmp)
2682+
ones(:,:) = 1.0 ; call masked_var_grounded(G, CS%dCS, ones, tmp)
26872683
if (CS%id_g_area > 0) then !grounded only ice sheet area
2688-
call integrate_over_ice_sheet_area(G, ISS, tmp, 1.0, val)
2684+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=1.0)
26892685
call post_scalar_data(CS%id_g_area,val,CS%diag)
26902686
endif
26912687
if (CS%id_f_area > 0) then !floating only ice sheet area (ice shelf area)
2692-
call integrate_over_ice_sheet_area(G, ISS, 1.0-tmp, 1.0, val)
2688+
val = integrate_over_ice_sheet_area(G, ISS, 1.0-tmp, unscale=1.0)
26932689
call post_scalar_data(CS%id_f_area,val,CS%diag)
26942690
endif
26952691
endif
@@ -2700,13 +2696,13 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
27002696
if (CS%id_Ant_vaf > 0) call post_scalar_data(CS%id_Ant_vaf ,vaf ,CS%diag) !current vaf
27012697
if (CS%id_Ant_dvafdt > 0) call post_scalar_data(CS%id_Ant_dvafdt,(vaf-vaf0_A)*Itime_step,CS%diag) !d(vaf)/dt
27022698
if (CS%id_Ant_adott > 0 .or. CS%id_Ant_adot > 0) then !surface accumulation - surface melt
2703-
call integrate_over_ice_sheet_area(G, ISS, dh_adott, US%Z_to_m, val, hemisphere=0)
2699+
val = integrate_over_ice_sheet_area(G, ISS, dh_adott, unscale=US%Z_to_m, hemisphere=0)
27042700
if (CS%id_Ant_adott > 0) call post_scalar_data(CS%id_Ant_adott,val ,CS%diag)
27052701
if (CS%id_Ant_adot > 0) call post_scalar_data(CS%id_Ant_adot ,val*Itime_step,CS%diag)
27062702
endif
27072703
if (CS%id_Ant_g_adott > 0 .or. CS%id_Ant_g_adot > 0) then !grounded only: surface accumulation - surface melt
27082704
call masked_var_grounded(G,CS%dCS,dh_adott,tmp)
2709-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=0)
2705+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=0)
27102706
if (CS%id_Ant_g_adott > 0) call post_scalar_data(CS%id_Ant_g_adott,val ,CS%diag)
27112707
if (CS%id_Ant_g_adot > 0) call post_scalar_data(CS%id_Ant_g_adot ,val*Itime_step,CS%diag)
27122708
endif
@@ -2715,12 +2711,12 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
27152711
do j=js,je ; do i=is,ie
27162712
tmp(i,j) = dh_adott(i,j) - tmp(i,j)
27172713
enddo; enddo
2718-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=0)
2714+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=0)
27192715
if (CS%id_Ant_f_adott > 0) call post_scalar_data(CS%id_Ant_f_adott,val ,CS%diag)
27202716
if (CS%id_Ant_f_adot > 0) call post_scalar_data(CS%id_Ant_f_adot ,val*Itime_step,CS%diag)
27212717
endif
27222718
if (CS%id_Ant_bdott > 0 .or. CS%id_Ant_bdot > 0) then !bottom accumulation - bottom melt
2723-
call integrate_over_ice_sheet_area(G, ISS, dh_bdott, US%Z_to_m, val, hemisphere=0)
2719+
val = integrate_over_ice_sheet_area(G, ISS, dh_bdott, unscale=US%Z_to_m, hemisphere=0)
27242720
if (CS%id_Ant_bdott > 0) call post_scalar_data(CS%id_Ant_bdott,val ,CS%diag)
27252721
if (CS%id_Ant_bdot > 0) call post_scalar_data(CS%id_Ant_bdot ,val*Itime_step,CS%diag)
27262722
endif
@@ -2729,7 +2725,7 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
27292725
do j=js,je ; do i=is,ie
27302726
if (dh_bdott(i,j) < 0) tmp(i,j) = -dh_bdott(i,j)
27312727
enddo; enddo
2732-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=0)
2728+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=0)
27332729
if (CS%id_Ant_bdott_melt > 0) call post_scalar_data(CS%id_Ant_bdott_melt,val ,CS%diag)
27342730
if (CS%id_Ant_bdot_melt > 0) call post_scalar_data(CS%id_Ant_bdot_melt ,val*Itime_step,CS%diag)
27352731
endif
@@ -2738,22 +2734,22 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
27382734
do j=js,je ; do i=is,ie
27392735
if (dh_bdott(i,j) > 0) tmp(i,j) = dh_bdott(i,j)
27402736
enddo; enddo
2741-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=0)
2737+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=0)
27422738
if (CS%id_Ant_bdott_accum > 0) call post_scalar_data(CS%id_Ant_bdott_accum,val ,CS%diag)
27432739
if (CS%id_Ant_bdot_accum > 0) call post_scalar_data(CS%id_Ant_bdot_accum ,val*Itime_step,CS%diag)
27442740
endif
27452741
if (CS%id_Ant_t_area > 0) then !ice sheet area
2746-
tmp(:,:) = 1.0; call integrate_over_ice_sheet_area(G, ISS, tmp, 1.0, val, hemisphere=0)
2742+
tmp(:,:) = 1.0; val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=1.0, hemisphere=0)
27472743
call post_scalar_data(CS%id_Ant_t_area,val,CS%diag)
27482744
endif
27492745
if (CS%id_Ant_g_area > 0 .or. CS%id_Ant_f_area > 0) then
2750-
tmp(:,:) = 1.0; call masked_var_grounded(G,CS%dCS,tmp,tmp)
2746+
ones(:,:) = 1.0 ; call masked_var_grounded(G, CS%dCS, ones, tmp)
27512747
if (CS%id_Ant_g_area > 0) then !grounded only ice sheet area
2752-
call integrate_over_ice_sheet_area(G, ISS, tmp, 1.0, val, hemisphere=0)
2748+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=1.0, hemisphere=0)
27532749
call post_scalar_data(CS%id_Ant_g_area,val,CS%diag)
27542750
endif
27552751
if (CS%id_Ant_f_area > 0) then !floating only ice sheet area (ice shelf area)
2756-
call integrate_over_ice_sheet_area(G, ISS, 1.0-tmp, 1.0, val, hemisphere=0)
2752+
val = integrate_over_ice_sheet_area(G, ISS, 1.0-tmp, unscale=1.0, hemisphere=0)
27572753
call post_scalar_data(CS%id_Ant_f_area,val,CS%diag)
27582754
endif
27592755
endif
@@ -2764,13 +2760,13 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
27642760
if (CS%id_Gr_vaf > 0) call post_scalar_data(CS%id_Gr_vaf ,vaf ,CS%diag) !current vaf
27652761
if (CS%id_Gr_dvafdt > 0) call post_scalar_data(CS%id_Gr_dvafdt,(vaf-vaf0_A)*Itime_step,CS%diag) !d(vaf)/dt
27662762
if (CS%id_Gr_adott > 0 .or. CS%id_Gr_adot > 0) then !surface accumulation - surface melt
2767-
call integrate_over_ice_sheet_area(G, ISS, dh_adott, US%Z_to_m, val, hemisphere=1)
2763+
val = integrate_over_ice_sheet_area(G, ISS, dh_adott, unscale=US%Z_to_m, hemisphere=1)
27682764
if (CS%id_Gr_adott > 0) call post_scalar_data(CS%id_Gr_adott,val ,CS%diag)
27692765
if (CS%id_Gr_adot > 0) call post_scalar_data(CS%id_Gr_adot ,val*Itime_step,CS%diag)
27702766
endif
27712767
if (CS%id_Gr_g_adott > 0 .or. CS%id_Gr_g_adot > 0) then !grounded only: surface accumulation - surface melt
27722768
call masked_var_grounded(G,CS%dCS,dh_adott,tmp)
2773-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=1)
2769+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=1)
27742770
if (CS%id_Gr_g_adott > 0) call post_scalar_data(CS%id_Gr_g_adott,val ,CS%diag)
27752771
if (CS%id_Gr_g_adot > 0) call post_scalar_data(CS%id_Gr_g_adot ,val*Itime_step,CS%diag)
27762772
endif
@@ -2779,12 +2775,12 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
27792775
do j=js,je ; do i=is,ie
27802776
tmp(i,j) = dh_adott(i,j) - tmp(i,j)
27812777
enddo; enddo
2782-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=1)
2778+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=1)
27832779
if (CS%id_Gr_f_adott > 0) call post_scalar_data(CS%id_Gr_f_adott,val ,CS%diag)
27842780
if (CS%id_Gr_f_adot > 0) call post_scalar_data(CS%id_Gr_f_adot ,val*Itime_step,CS%diag)
27852781
endif
27862782
if (CS%id_Gr_bdott > 0 .or. CS%id_Gr_bdot > 0) then !bottom accumulation - bottom melt
2787-
call integrate_over_ice_sheet_area(G, ISS, dh_bdott, US%Z_to_m, val, hemisphere=1)
2783+
val = integrate_over_ice_sheet_area(G, ISS, dh_bdott, unscale=US%Z_to_m, hemisphere=1)
27882784
if (CS%id_Gr_bdott > 0) call post_scalar_data(CS%id_Gr_bdott,val ,CS%diag)
27892785
if (CS%id_Gr_bdot > 0) call post_scalar_data(CS%id_Gr_bdot ,val*Itime_step,CS%diag)
27902786
endif
@@ -2793,7 +2789,7 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
27932789
do j=js,je ; do i=is,ie
27942790
if (dh_bdott(i,j) < 0) tmp(i,j) = -dh_bdott(i,j)
27952791
enddo; enddo
2796-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=1)
2792+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=1)
27972793
if (CS%id_Gr_bdott_melt > 0) call post_scalar_data(CS%id_Gr_bdott_melt,val ,CS%diag)
27982794
if (CS%id_Gr_bdot_melt > 0) call post_scalar_data(CS%id_Gr_bdot_melt ,val*Itime_step,CS%diag)
27992795
endif
@@ -2802,22 +2798,22 @@ subroutine process_and_post_scalar_data(CS, vaf0, vaf0_A, vaf0_G, Itime_step, dh
28022798
do j=js,je ; do i=is,ie
28032799
if (dh_bdott(i,j) > 0) tmp(i,j) = dh_bdott(i,j)
28042800
enddo; enddo
2805-
call integrate_over_ice_sheet_area(G, ISS, tmp, US%Z_to_m, val, hemisphere=1)
2801+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=US%Z_to_m, hemisphere=1)
28062802
if (CS%id_Gr_bdott_accum > 0) call post_scalar_data(CS%id_Gr_bdott_accum,val ,CS%diag)
28072803
if (CS%id_Gr_bdot_accum > 0) call post_scalar_data(CS%id_Gr_bdot_accum ,val*Itime_step,CS%diag)
28082804
endif
28092805
if (CS%id_Gr_t_area > 0) then !ice sheet area
2810-
tmp(:,:) = 1.0; call integrate_over_ice_sheet_area(G, ISS, tmp, 1.0, val, hemisphere=1)
2806+
tmp(:,:) = 1.0; val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=1.0, hemisphere=1)
28112807
call post_scalar_data(CS%id_Gr_t_area,val,CS%diag)
28122808
endif
28132809
if (CS%id_Gr_g_area > 0 .or. CS%id_Gr_f_area > 0) then
2814-
tmp(:,:) = 1.0; call masked_var_grounded(G,CS%dCS,tmp,tmp)
2810+
ones(:,:) = 1.0 ; call masked_var_grounded(G, CS%dCS, ones, tmp)
28152811
if (CS%id_Gr_g_area > 0) then !grounded only ice sheet area
2816-
call integrate_over_ice_sheet_area(G, ISS, tmp, 1.0, val, hemisphere=1)
2812+
val = integrate_over_ice_sheet_area(G, ISS, tmp, unscale=1.0, hemisphere=1)
28172813
call post_scalar_data(CS%id_Gr_g_area,val,CS%diag)
28182814
endif
28192815
if (CS%id_Gr_f_area > 0) then !floating only ice sheet area (ice shelf area)
2820-
call integrate_over_ice_sheet_area(G, ISS, 1.0-tmp, 1.0, val, hemisphere=1)
2816+
val = integrate_over_ice_sheet_area(G, ISS, 1.0-tmp, unscale=1.0, hemisphere=1)
28212817
call post_scalar_data(CS%id_Gr_f_area,val,CS%diag)
28222818
endif
28232819
endif

0 commit comments

Comments
 (0)