Skip to content

Commit

Permalink
new export spurious latent land (SPLH=LHACC); edited long names of EV…
Browse files Browse the repository at this point in the history
…LAND and spurious land terms
  • Loading branch information
gmao-rreichle committed Jun 28, 2024
1 parent 84d9d82 commit afdc6ad
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'EVLAND', &
LONG_NAME = 'Evaporation_land', &
LONG_NAME = 'Total_evapotranspiration_land', &
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand Down Expand Up @@ -1955,7 +1955,16 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPLAND', &
LONG_NAME = 'rate_of_spurious_land_energy_source',&
LONG_NAME = 'Spurious_sensible_heat_flux_land',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPLH', &
LONG_NAME = 'Spurious_latent_heat_flux_land',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand All @@ -1964,7 +1973,7 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPWATR', &
LONG_NAME = 'rate_of_spurious_land_water_source',&
LONG_NAME = 'Spurious_evapotranspiration_land',&
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand All @@ -1973,7 +1982,7 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPSNOW', &
LONG_NAME = 'rate_of_spurious_snow_energy',&
LONG_NAME = 'Spurious_snow_energy_flux_land',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand Down Expand Up @@ -5425,6 +5434,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer, dimension(:,:) :: DWLAND => NULL()
real, pointer, dimension(:,:) :: DHLAND => NULL()
real, pointer, dimension(:,:) :: SPLAND => NULL()
real, pointer, dimension(:,:) :: SPLH => NULL()
real, pointer, dimension(:,:) :: SPWATR => NULL()
real, pointer, dimension(:,:) :: SPSNOW => NULL()
real, pointer, dimension(:,:) :: RCU => NULL()
Expand Down Expand Up @@ -5727,6 +5737,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer, dimension(:) :: DWLANDTILE => NULL()
real, pointer, dimension(:) :: DHLANDTILE => NULL()
real, pointer, dimension(:) :: SPLANDTILE => NULL()
real, pointer, dimension(:) :: SPLHTILE => NULL()
real, pointer, dimension(:) :: SPWATRTILE => NULL()
real, pointer, dimension(:) :: SPSNOWTILE => NULL()
real, pointer, dimension(:,:) :: RDU001TILE => NULL()
Expand Down Expand Up @@ -6593,6 +6604,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(EXPORT , DWLAND , 'DWLAND' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , DHLAND , 'DHLAND' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , SPLAND , 'SPLAND' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , SPLH , 'SPLH' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , SPWATR , 'SPWATR' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , SPSNOW , 'SPSNOW' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , RDU001 , 'RDU001' , RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -7201,6 +7213,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
call MKTILE(DWLAND ,DWLANDTILE ,NT,RC=STATUS); VERIFY_(STATUS)
call MKTILE(DHLAND ,DHLANDTILE ,NT,RC=STATUS); VERIFY_(STATUS)
call MKTILE(SPLAND ,SPLANDTILE ,NT,RC=STATUS); VERIFY_(STATUS)
call MKTILE(SPLH ,SPLHTILE ,NT,RC=STATUS); VERIFY_(STATUS)
call MKTILE(SPWATR ,SPWATRTILE ,NT,RC=STATUS); VERIFY_(STATUS)
call MKTILE(SPSNOW ,SPSNOWTILE ,NT,RC=STATUS); VERIFY_(STATUS)
call MKTILE(RDU001 ,RDU001TILE ,NT,RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -8078,6 +8091,10 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_LocStreamTransform( LOCSTREAM,SPLAND,SPLANDTILE, RC=STATUS)
VERIFY_(STATUS)
endif
if(associated(SPLH )) then
call MAPL_LocStreamTransform( LOCSTREAM,SPLH ,SPLHTILE , RC=STATUS)
VERIFY_(STATUS)
endif
if(associated(SPWATR)) then
call MAPL_LocStreamTransform( LOCSTREAM,SPWATR,SPWATRTILE, RC=STATUS)
VERIFY_(STATUS)
Expand Down Expand Up @@ -8732,6 +8749,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
if(associated(DWLANDTILE )) deallocate(DWLANDTILE )
if(associated(DHLANDTILE )) deallocate(DHLANDTILE )
if(associated(SPLANDTILE )) deallocate(SPLANDTILE )
if(associated(SPLHTILE )) deallocate(SPLHTILE )
if(associated(SPWATRTILE )) deallocate(SPWATRTILE )
if(associated(SPSNOWTILE )) deallocate(SPSNOWTILE )
if(associated(RDU001TILE )) deallocate(RDU001TILE )
Expand Down Expand Up @@ -9044,6 +9062,8 @@ subroutine DOTYPE(type,RC)
VERIFY_(STATUS)
call MAPL_GetPointer(GEX(type), dum, 'SPLAND' , ALLOC=associated(SPLANDTILE ), notFoundOK=.true., RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetPointer(GEX(type), dum, 'SPLH' , ALLOC=associated(SPLHTILE ), notFoundOK=.true., RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetPointer(GEX(type), dum, 'SPWATR' , ALLOC=associated(SPWATRTILE ), notFoundOK=.true., RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetPointer(GEX(type), dum, 'SPSNOW' , ALLOC=associated(SPSNOWTILE ), notFoundOK=.true., RC=STATUS)
Expand Down Expand Up @@ -9684,6 +9704,10 @@ subroutine DOTYPE(type,RC)
call FILLOUT_TILE(GEX(type), 'SPLAND', SPLANDTILE, XFORM, RC=STATUS)
VERIFY_(STATUS)
end if
if(associated(SPLHTILE )) then
call FILLOUT_TILE(GEX(type), 'SPLH' , SPLHTILE, XFORM, RC=STATUS)
VERIFY_(STATUS)
end if
if(associated(SPWATRTILE)) then
call FILLOUT_TILE(GEX(type), 'SPWATR', SPWATRTILE, XFORM, RC=STATUS)
VERIFY_(STATUS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,11 @@ subroutine SetServices ( GC, RC )
CHILD_ID = CATCH(1), &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC, &
SHORT_NAME = 'SPLH', &
CHILD_ID = CATCH(1), &
RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC, &
SHORT_NAME = 'SPWATR', &
CHILD_ID = CATCH(1), &
Expand Down Expand Up @@ -1116,6 +1121,9 @@ subroutine SetServices ( GC, RC )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'SPLAND' , CHILD_ID = CATCHCN(1), RC=STATUS )
VERIFY_(STATUS)
! will need later for CatchCN:
! call MAPL_AddExportSpec ( GC, SHORT_NAME = 'SPLH' , CHILD_ID = CATCHCN(1), RC=STATUS )
! VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'SPWATR' , CHILD_ID = CATCHCN(1), RC=STATUS )
VERIFY_(STATUS)
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'SPSNOW' , CHILD_ID = CATCHCN(1), RC=STATUS )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'EVLAND', &
LONG_NAME = 'Evaporation_land', &
LONG_NAME = 'Total_evapotranspiration_land', &
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsTileOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand Down Expand Up @@ -2563,7 +2563,16 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPLAND', &
LONG_NAME = 'rate_of_spurious_land_energy_source',&
LONG_NAME = 'Spurious_sensible_heat_flux_land',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsTileOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPLH', &
LONG_NAME = 'Spurious_latent_heat_flux_land',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsTileOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand All @@ -2572,7 +2581,7 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPWATR', &
LONG_NAME = 'rate_of_spurious_land_water_source',&
LONG_NAME = 'Spurious_evapotranspiration_land',&
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsTileOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand All @@ -2581,7 +2590,7 @@ subroutine SetServices ( GC, RC )

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SPSNOW', &
LONG_NAME = 'rate_of_spurious_snow_energy',&
LONG_NAME = 'Spurious_snow_energy_flux_land',&
UNITS = 'W m-2', &
DIMS = MAPL_DimsTileOnly, &
VLOCATION = MAPL_VLocationNone, &
Expand Down Expand Up @@ -3903,6 +3912,7 @@ subroutine Driver ( RC )
real, dimension(:), pointer :: DWLAND
real, dimension(:), pointer :: DHLAND
real, dimension(:), pointer :: SPLAND
real, dimension(:), pointer :: SPLH
real, dimension(:), pointer :: SPWATR
real, dimension(:), pointer :: SPSNOW

Expand Down Expand Up @@ -4445,6 +4455,7 @@ subroutine Driver ( RC )
call MAPL_GetPointer(EXPORT,DWLAND, 'DWLAND' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,DHLAND, 'DHLAND' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,SPLAND, 'SPLAND' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,SPLH, 'SPLH' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,SPWATR, 'SPWATR' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,SPSNOW, 'SPSNOW' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,RMELTDU001,'RMELTDU001', RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -5563,6 +5574,7 @@ subroutine Driver ( RC )
QC(:,FWLT) = QA4_0
EVACC = 0.0
SHACC = 0.0
LHACC = 0.0
endif

QC(:,FSNW) = GEOS_QSAT ( TC(:,FSNW), PS, PASCALS=.true., RAMP=0.0 )
Expand Down Expand Up @@ -5653,19 +5665,24 @@ subroutine Driver ( RC )
QST = QST + QC(:,N) *FR(:,N)
end do

if (CATCH_INTERNAL_STATE%CATCH_OFFLINE == 0) then
!amm add correction term to latent heat diagnostics (HLATN is always allocated)
! this will impact the export LHLAND
HLATN = HLATN - LHACC
! also add some portion of the correction term to evap from soil, int, veg and snow
! if (CATCH_INTERNAL_STATE%CATCH_OFFLINE == 0) then
! !amm add correction term to latent heat diagnostics (HLATN is always allocated)
! ! this will impact the export LHLAND
! HLATN = HLATN - LHACC
! ! also add some portion of the correction term to evap from soil, int, veg and snow

SUMEV = EVPICE+EVPSOI+EVPVEG+EVPINT
where(SUMEV>0.)
EVPICE = EVPICE - EVACC*EVPICE/SUMEV
EVPSOI = EVPSOI - EVACC*EVPSOI/SUMEV
EVPINT = EVPINT - EVACC*EVPINT/SUMEV
EVPVEG = EVPVEG - EVACC*EVPVEG/SUMEV
where(SUMEV/=0.) ! apportion residual based on (non-zero) evap/dewfall flux
EVPICE = EVPICE - EVACC*EVPICE/SUMEV
EVPSOI = EVPSOI - EVACC*EVPSOI/SUMEV
EVPINT = EVPINT - EVACC*EVPINT/SUMEV
EVPVEG = EVPVEG - EVACC*EVPVEG/SUMEV
elsewhere ! apportion residual based on ASNOW (for simplicity, add snow-free portion to EVPSOI)
EVPICE = EVPICE - EVACC*ASNOW
EVPSOI = EVPSOI - EVACC*(1.-ASNOW)
endwhere
endif

! endif

if(associated( LST )) LST = TST
if(associated( TPSURF))TPSURF = TSURF
Expand All @@ -5685,7 +5702,7 @@ subroutine Driver ( RC )
if(associated(SNOLAND)) SNOLAND = SLDTOT ! note, not just SNO
if(associated(DRPARLAND)) DRPARLAND = DRPAR
if(associated(DFPARLAND)) DFPARLAND = DFPAR
if(associated(LHLAND)) LHLAND = HLATN
if(associated(LHLAND)) LHLAND = HLATN-LHACC
if(associated(SHLAND)) SHLAND = SHOUT-SHACC
if(associated(SWLAND)) SWLAND = SWNDSRF
if(associated(LWLAND)) LWLAND = LWNDSRF
Expand All @@ -5711,6 +5728,7 @@ subroutine Driver ( RC )
if(associated(DWLAND)) DWLAND = WCHANGE
if(associated(DHLAND)) DHLAND = ECHANGE
if(associated(SPLAND)) SPLAND = SHACC
if(associated(SPLH )) SPLH = LHACC
if(associated(SPWATR)) SPWATR = EVACC
if(associated(SPSNOW)) SPSNOW = HSNACC

Expand Down

0 comments on commit afdc6ad

Please sign in to comment.