Skip to content

Commit

Permalink
more fixes to make N_constit=0 work
Browse files Browse the repository at this point in the history
  • Loading branch information
gmao-rreichle committed Feb 8, 2025
1 parent bb9d652 commit 8254a10
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5986,11 +5986,13 @@ subroutine Driver ( RC )

!--------------- GOSWIM IMPORTS FROM GOCART ---------------
! Initialization
RCONSTIT(:,:,:) = 0.0
TOTDEPOS(:,:) = 0.0
RMELT(:,:) = 0.0
if (N_constit>0) then
RCONSTIT(:,:,:) = 0.0
TOTDEPOS(:,:) = 0.0
RMELT(:,:) = 0.0
end if
!------------------------------------------------------------------

! Zero the light-absorbing aerosol (LAA) deposition rates from GOCART:

select case (catchcn_internal%AEROSOL_DEPOSITION)
Expand Down Expand Up @@ -6027,6 +6029,8 @@ subroutine Driver ( RC )
OCSD(:,:)=0.

end select

if (catchcn_internal%N_CONST_LAND4SNWALB /= 0) then

! Convert the dimentions for LAAs from GEOS_SurfGridComp.F90 to GEOS_LandIceGridComp.F90
! Note: Explanations of each variable
Expand Down Expand Up @@ -6066,8 +6070,6 @@ subroutine Driver ( RC )

! --------------- GOSWIM PROGRNOSTICS ---------------------------

if (catchcn_internal%N_CONST_LAND4SNWALB /= 0) then

! Conversion of the masses of the snow impurities
! Note: Explanations of each variable
! Number of snow layer is 15: N = 1-15
Expand Down Expand Up @@ -7519,15 +7521,18 @@ subroutine Driver ( RC )
if(associated(FICE2 )) FICE2 = max( min( FICESOUT(2,:),1.0 ), 0.0 )
if(associated(FICE3 )) FICE3 = max( min( FICESOUT(3,:),1.0 ), 0.0 )

if(associated(RMELTDU001)) RMELTDU001 = RMELT(:,1)
if(associated(RMELTDU002)) RMELTDU002 = RMELT(:,2)
if(associated(RMELTDU003)) RMELTDU003 = RMELT(:,3)
if(associated(RMELTDU004)) RMELTDU004 = RMELT(:,4)
if(associated(RMELTDU005)) RMELTDU005 = RMELT(:,5)
if(associated(RMELTBC001)) RMELTBC001 = RMELT(:,6)
if(associated(RMELTBC002)) RMELTBC002 = RMELT(:,7)
if(associated(RMELTOC001)) RMELTOC001 = RMELT(:,8)
if(associated(RMELTOC002)) RMELTOC002 = RMELT(:,9)
if (N_constit>0) then
if(associated(RMELTDU001)) RMELTDU001 = RMELT(:,1)
if(associated(RMELTDU002)) RMELTDU002 = RMELT(:,2)
if(associated(RMELTDU003)) RMELTDU003 = RMELT(:,3)
if(associated(RMELTDU004)) RMELTDU004 = RMELT(:,4)
if(associated(RMELTDU005)) RMELTDU005 = RMELT(:,5)
if(associated(RMELTBC001)) RMELTBC001 = RMELT(:,6)
if(associated(RMELTBC002)) RMELTBC002 = RMELT(:,7)
if(associated(RMELTOC001)) RMELTOC001 = RMELT(:,8)
if(associated(RMELTOC002)) RMELTOC002 = RMELT(:,9)
end if

if(associated(PEATCLSM_FSWCHANGE)) then
where (POROS >= PEATCLSM_POROS_THRESHOLD)
PEATCLSM_FSWCHANGE = FSW_CHANGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6015,9 +6015,11 @@ subroutine Driver ( RC )

!--------------- GOSWIM IMPORTS FROM GOCART ---------------
! Initialization
RCONSTIT(:,:,:) = 0.0
TOTDEPOS(:,:) = 0.0
RMELT(:,:) = 0.0
if (N_constit>0) then
RCONSTIT(:,:,:) = 0.0
TOTDEPOS(:,:) = 0.0
RMELT(:,:) = 0.0
end if
!------------------------------------------------------------------

! Zero the light-absorbing aerosol (LAA) deposition rates from GOCART:
Expand Down Expand Up @@ -6057,6 +6059,8 @@ subroutine Driver ( RC )

end select

if (catchcn_internal%N_CONST_LAND4SNWALB /= 0) then

! Convert the dimentions for LAAs from GEOS_SurfGridComp.F90 to GEOS_LandIceGridComp.F90
! Note: Explanations of each variable
! TOTDEPOS(:,1): Combined dust deposition from size bin 1 (dry, conv-scav, ls-scav, sed)
Expand Down Expand Up @@ -6095,8 +6099,6 @@ subroutine Driver ( RC )

! --------------- GOSWIM PROGRNOSTICS ---------------------------

if (catchcn_internal%N_CONST_LAND4SNWALB /= 0) then

! Conversion of the masses of the snow impurities
! Note: Explanations of each variable
! Number of snow layer is 15: N = 1-15
Expand Down Expand Up @@ -7800,15 +7802,18 @@ subroutine Driver ( RC )
if(associated(FICE2 )) FICE2 = max( min( FICESOUT(2,:),1.0 ), 0.0 )
if(associated(FICE3 )) FICE3 = max( min( FICESOUT(3,:),1.0 ), 0.0 )

if(associated(RMELTDU001)) RMELTDU001 = RMELT(:,1)
if(associated(RMELTDU002)) RMELTDU002 = RMELT(:,2)
if(associated(RMELTDU003)) RMELTDU003 = RMELT(:,3)
if(associated(RMELTDU004)) RMELTDU004 = RMELT(:,4)
if(associated(RMELTDU005)) RMELTDU005 = RMELT(:,5)
if(associated(RMELTBC001)) RMELTBC001 = RMELT(:,6)
if(associated(RMELTBC002)) RMELTBC002 = RMELT(:,7)
if(associated(RMELTOC001)) RMELTOC001 = RMELT(:,8)
if(associated(RMELTOC002)) RMELTOC002 = RMELT(:,9)
if (N_constit>0) then
if(associated(RMELTDU001)) RMELTDU001 = RMELT(:,1)
if(associated(RMELTDU002)) RMELTDU002 = RMELT(:,2)
if(associated(RMELTDU003)) RMELTDU003 = RMELT(:,3)
if(associated(RMELTDU004)) RMELTDU004 = RMELT(:,4)
if(associated(RMELTDU005)) RMELTDU005 = RMELT(:,5)
if(associated(RMELTBC001)) RMELTBC001 = RMELT(:,6)
if(associated(RMELTBC002)) RMELTBC002 = RMELT(:,7)
if(associated(RMELTOC001)) RMELTOC001 = RMELT(:,8)
if(associated(RMELTOC002)) RMELTOC002 = RMELT(:,9)
end if

if(associated(PEATCLSM_FSWCHANGE )) then
where (POROS >= PEATCLSM_POROS_THRESHOLD)
PEATCLSM_FSWCHANGE = FSW_CHANGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4904,9 +4904,11 @@ subroutine Driver ( RC )

!--------------- GOSWIM IMPORTS FROM GOCART ---------------
! Initialization
RCONSTIT(:,:,:) = 0.0
TOTDEPOS(:,:) = 0.0
RMELT(:,:) = 0.0
if (N_constit>0) then
RCONSTIT(:,:,:) = 0.0
TOTDEPOS(:,:) = 0.0
RMELT(:,:) = 0.0
end if
!------------------------------------------------------------------

! Zero the light-absorbing aerosol (LAA) deposition rates from GOCART:
Expand Down Expand Up @@ -4946,6 +4948,8 @@ subroutine Driver ( RC )

end select

if (CATCH_INTERNAL_STATE%N_CONST_LAND4SNWALB /= 0) then

! Convert the dimentions for LAAs from GEOS_SurfGridComp.F90 to GEOS_LandIceGridComp.F90
! Note: Explanations of each variable
! TOTDEPOS(:,1): Combined dust deposition from size bin 1 (dry, conv-scav, ls-scav, sed)
Expand Down Expand Up @@ -5005,7 +5009,6 @@ subroutine Driver ( RC )
! RCONSTIT(NTILES,N,14): Sea salt mass from size bin 4 in layer N
! RCONSTIT(NTILES,N,15): Sea salt mass from size bin 5 in layer N

if (CATCH_INTERNAL_STATE%N_CONST_LAND4SNWALB /= 0) then
RCONSTIT(:,:,1) = RDU001(:,:)
RCONSTIT(:,:,2) = RDU002(:,:)
RCONSTIT(:,:,3) = RDU003(:,:)
Expand Down Expand Up @@ -5933,15 +5936,18 @@ subroutine Driver ( RC )
if(associated(FICE2 )) FICE2 = max( min( FICESOUT(2,:),1.0 ), 0.0 )
if(associated(FICE3 )) FICE3 = max( min( FICESOUT(3,:),1.0 ), 0.0 )

if(associated(RMELTDU001)) RMELTDU001 = RMELT(:,1)
if(associated(RMELTDU002)) RMELTDU002 = RMELT(:,2)
if(associated(RMELTDU003)) RMELTDU003 = RMELT(:,3)
if(associated(RMELTDU004)) RMELTDU004 = RMELT(:,4)
if(associated(RMELTDU005)) RMELTDU005 = RMELT(:,5)
if(associated(RMELTBC001)) RMELTBC001 = RMELT(:,6)
if(associated(RMELTBC002)) RMELTBC002 = RMELT(:,7)
if(associated(RMELTOC001)) RMELTOC001 = RMELT(:,8)
if(associated(RMELTOC002)) RMELTOC002 = RMELT(:,9)

if (N_constit>0) then
if(associated(RMELTDU001)) RMELTDU001 = RMELT(:,1)
if(associated(RMELTDU002)) RMELTDU002 = RMELT(:,2)
if(associated(RMELTDU003)) RMELTDU003 = RMELT(:,3)
if(associated(RMELTDU004)) RMELTDU004 = RMELT(:,4)
if(associated(RMELTDU005)) RMELTDU005 = RMELT(:,5)
if(associated(RMELTBC001)) RMELTBC001 = RMELT(:,6)
if(associated(RMELTBC002)) RMELTBC002 = RMELT(:,7)
if(associated(RMELTOC001)) RMELTOC001 = RMELT(:,8)
if(associated(RMELTOC002)) RMELTOC002 = RMELT(:,9)
end if

if(associated(DZGT1 )) DZGT1 = DZGT(1) ! [m]
if(associated(DZGT2 )) DZGT2 = DZGT(2) ! [m]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2762,10 +2762,12 @@ subroutine LANDICECORE(RC)
if(associated(TICE0 )) TICE0 = 0.0
if(associated(ACCUM )) ACCUM = 0.0
if(associated(MELTWTR )) MELTWTR = 0.0

TOTDEPOS = 0.0
RCONSTIT = 0.0
RMELT = 0.0

if (N_constit>0) then
TOTDEPOS = 0.0
RCONSTIT = 0.0
RMELT = 0.0
end if

! Zero the light-absorbing aerosol (LAA) deposition rates from GOCART:

Expand Down Expand Up @@ -2804,6 +2806,9 @@ subroutine LANDICECORE(RC)

end select


if (N_CONST_LANDICE4SNWALB /=0) then

! Convert the dimentions for LAAs from GEOS_SurfGridComp.F90 to GEOS_LandIceGridComp.F90
! Note: Explanations of each variable
! TOTDEPOS(:,1): Combined dust deposition from size bin 1 (dry, conv-scav, ls-scav, sed)
Expand Down Expand Up @@ -2862,7 +2867,6 @@ subroutine LANDICECORE(RC)
! RCONSTIT(NT,N,14): Sea salt mass from size bin 4 in layer N
! RCONSTIT(NT,N,15): Sea salt mass from size bin 5 in layer N

if (N_CONST_LANDICE4SNWALB /=0) then
RCONSTIT(:,:,1) = IRDU001(:,:)
RCONSTIT(:,:,2) = IRDU002(:,:)
RCONSTIT(:,:,3) = IRDU003(:,:)
Expand Down Expand Up @@ -3113,16 +3117,18 @@ subroutine LANDICECORE(RC)
if(associated(IROC001)) IROC001(k,:) = RCONSTIT(k,:,8)
if(associated(IROC002)) IROC002(k,:) = RCONSTIT(k,:,9)
end if
if(associated(RMELTDU001)) RMELTDU001(k) = RMELT(k,1)
if(associated(RMELTDU002)) RMELTDU002(k) = RMELT(k,2)
if(associated(RMELTDU003)) RMELTDU003(k) = RMELT(k,3)
if(associated(RMELTDU004)) RMELTDU004(k) = RMELT(k,4)
if(associated(RMELTDU005)) RMELTDU005(k) = RMELT(k,5)
if(associated(RMELTBC001)) RMELTBC001(k) = RMELT(k,6)
if(associated(RMELTBC002)) RMELTBC002(k) = RMELT(k,7)
if(associated(RMELTOC001)) RMELTOC001(k) = RMELT(k,8)
if(associated(RMELTOC002)) RMELTOC002(k) = RMELT(k,9)

if (N_constit>0) then
if(associated(RMELTDU001)) RMELTDU001(k) = RMELT(k,1)
if(associated(RMELTDU002)) RMELTDU002(k) = RMELT(k,2)
if(associated(RMELTDU003)) RMELTDU003(k) = RMELT(k,3)
if(associated(RMELTDU004)) RMELTDU004(k) = RMELT(k,4)
if(associated(RMELTDU005)) RMELTDU005(k) = RMELT(k,5)
if(associated(RMELTBC001)) RMELTBC001(k) = RMELT(k,6)
if(associated(RMELTBC002)) RMELTBC002(k) = RMELT(k,7)
if(associated(RMELTOC001)) RMELTOC001(k) = RMELT(k,8)
if(associated(RMELTOC002)) RMELTOC002(k) = RMELT(k,9)
end if

if(associated(LWC ))then
ZDEP = sum(SNDZ(k,:))
if(sum(WESN(k,:)) > MINSWE) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ subroutine StieglitzSnow_snowrt(tile_lon, tile_lat, &
! wesn : Layer water contents per unit area of catchment [kg/m^2]
! htsnn : Layer heat contents relative to liquid water at 0 C [J/m^2]
! sndz : Layer depths [m]
! rconstit : Mass of constituents in snow layer [kg] (i.e., [kg m-2])
! rconstit : Mass of constituents in snow layer [kg] (i.e., [kg m-2])
! rmelt : Flushed mass amount of constituents from the bottom snow layer [kg m-2 s-1 (kg/m^2/s)]
!*********
! OUTPUTS:
Expand Down Expand Up @@ -420,7 +420,8 @@ subroutine StieglitzSnow_snowrt(tile_lon, tile_lat, &
dtss = 0.
excswe = 0.

rmelt = 0.0
if (N_constit>0) rmelt = 0.0

mltwtr = 0.0
drho0 = 0.0
tksno = 0.0
Expand All @@ -441,7 +442,7 @@ subroutine StieglitzSnow_snowrt(tile_lon, tile_lat, &
do k=1,N_constit
rmelt(k)=sum(rconstit(:,k))/dts
enddo
rconstit(:,:) = 0.
if (N_constit>0) rconstit(:,:) = 0.

if(snowf > 0.) then ! only initialize with non-liquid part of precip
! liquid precip (rainf) is part of outflow from snow base (see "pre" above)
Expand Down Expand Up @@ -759,9 +760,9 @@ subroutine StieglitzSnow_snowrt(tile_lon, tile_lat, &
!**** Updated by Koster, August 27, 2002.

pre = 0.
rmelt(:) = 0.
if (N_constit>0) rmelt(:) = 0.
flow = 0.
flow_r(:) = 0.
if (N_constit>0) flow_r(:) = 0.

wesnperc = wesn

Expand All @@ -779,8 +780,11 @@ subroutine StieglitzSnow_snowrt(tile_lon, tile_lat, &

pre = max((1.-fices(i))*wesn(i), 0.)
flow = 0.
flow_r(:) = 0.
rconc(:) = 0.

if (N_constit>0) then
flow_r(:) = 0.
rconc(:) = 0.
end if

if(snowd > wemin) then

Expand Down

0 comments on commit 8254a10

Please sign in to comment.