Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add checks on snow states after application of LDAS increments; StieglitzSnow cleanup #834

Merged
merged 48 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
db5dc2a
StieglitzSnow.F90: fixed indentation, removed obsolete (commented-out…
gmao-rreichle Sep 28, 2023
e695045
StieglitzSnow.F90: make max snow density parameter (RHOMA) public
gmao-rreichle Sep 28, 2023
1741420
added StieglitzSnow_targetthick_land() and cleaned up DZ1MAX
gmao-rreichle Sep 28, 2023
8b32ffa
added checks on snow states after application of LDAS increments (cat…
gmao-rreichle Sep 28, 2023
24f9bda
Merge branch 'develop' into feature/rreichle/snow_check_after_apply_L…
gmao-rreichle Sep 29, 2023
7865466
fixed syntax error (build error) (StieglitzSnow.F90)
gmao-rreichle Sep 29, 2023
5071f65
fixed build error (catch_constants.f90)
gmao-rreichle Sep 29, 2023
d5bee8d
added missing variable declaration (catch_incr.F90)
gmao-rreichle Sep 29, 2023
cb8e94a
fixed typo in variable name (catch_incr.F90)
gmao-rreichle Sep 29, 2023
ce76a06
fixed array shapes (catch_incr.F90)
gmao-rreichle Sep 29, 2023
e46af99
fixed use statement (catch_incr.F90)
gmao-rreichle Sep 29, 2023
c25edec
fix science logic of check on snow states (catch_incr.F90)
gmao-rreichle Sep 29, 2023
4d78fe7
Merge branch 'develop' into feature/rreichle/snow_check_after_apply_L…
gmao-rreichle Sep 29, 2023
492bdc5
fixing type error in previous commit (catch_incr.F90)
gmao-rreichle Sep 29, 2023
0ddae03
ensure non-negative snow cover area fraction in StieglitzSnow_calc_as…
gmao-rreichle Sep 29, 2023
6bf8127
added optional arguments for turning off Catchment progn checks (for …
gmao-rreichle Sep 29, 2023
73f36b2
removed commented out StieglitzSnow routines from GEOS_LandIceGridCom…
gmao-rreichle Oct 2, 2023
876963f
clarified Landice vs Land subroutines for target snow layer thickness…
gmao-rreichle Oct 2, 2023
cb57052
revised "module procedure" for StieglitzSnow_calc_asnow (StieglitzSno…
gmao-rreichle Oct 2, 2023
a89b425
fixed minor error in previous commit
gmao-rreichle Oct 2, 2023
aa7c6bd
removed stray subroutine statement (StieglitzSnow.F90)
gmao-rreichle Oct 2, 2023
f20debd
renamed some public StieglitzSnow subroutines for clarity; cleanup of…
gmao-rreichle Oct 3, 2023
4aa7db0
make MINSWE and cpw public in StieglitzSnow.F90, use in GEOS_LandIceG…
gmao-rreichle Oct 3, 2023
6c4a9d1
removed redundant and comment-out lines (StieglitzSnow.F90)
gmao-rreichle Oct 4, 2023
6877c20
added some comments (StieglitzSnow.F90)
gmao-rreichle Oct 5, 2023
34b4552
added FICE[n] export for LAND tiles (Catchment) (GEOS_Catch*GridComp…
gmao-rreichle Oct 5, 2023
1800cd9
replace TileTypes with MAPL_LANDICE for simplicity (GEOS_LandIceGridC…
gmao-rreichle Oct 5, 2023
c7c8961
added missing "implicit none" to StieglitzSnow.F90
gmao-rreichle Oct 6, 2023
de94613
updated comment re. application of Catchment analysis increments (GEO…
gmao-rreichle Oct 6, 2023
b2be91b
single interface and single set of science equations for get_tf0d and…
gmao-rreichle Oct 6, 2023
fe2faad
fix error in variable name (StieglitzSnow.F90)
gmao-rreichle Oct 6, 2023
850cb10
fix calls to revised interface of scalar version of StieglitzSnow_cal…
gmao-rreichle Oct 6, 2023
667edae
commented out suspicious catchcn_calc_*() subroutines (catchmentCN.F90)
gmao-rreichle Oct 6, 2023
eef586e
added comments (StieglitzSnow.F90); white-space changes (catchment.F90)
gmao-rreichle Oct 11, 2023
687dd73
Merge branch 'develop' into feature/rreichle/snow_check_after_apply_L…
gmao-rreichle Oct 13, 2023
bf92dc8
Merge branch 'develop' into feature/rreichle/snow_check_after_apply_L…
gmao-rreichle Oct 13, 2023
9d9489a
Cleanup of StieglitzSnow and catch_constants (intended to be 0-diff)
gmao-rreichle Oct 14, 2023
a381db9
fixed syntax error (StieglitzSnow.F90)
gmao-rreichle Oct 14, 2023
67409e4
more syntax error fixes (StieglitzSnow.F90)
gmao-rreichle Oct 14, 2023
d82aca9
removed obsolete variables (StieglitzSnow.F90, catchment[CN].F90, GEO…
gmao-rreichle Oct 14, 2023
a3b94d8
fixed interface error from previous commits (StieglitzSnow.F90)
gmao-rreichle Oct 14, 2023
6d6f921
fixed snow parameter name (catch_constants.F90)
gmao-rreichle Oct 14, 2023
c3753f9
fix snow target layer thickness use statement (StieglitzSnow.F90) and…
gmao-rreichle Oct 14, 2023
82d3ce2
fix dimension of fhgnd declaration (StieglitzSnow.F90)
gmao-rreichle Oct 14, 2023
d6d39be
reordered arguments of snowrt() into groups with matching intent (Sti…
gmao-rreichle Oct 15, 2023
b036f48
remove obsolete use statements (lsm_routines.F90)
gmao-rreichle Oct 15, 2023
7856ac7
use StieglitzSnow_calc_asnow() instead of writing out equation each t…
gmao-rreichle Oct 15, 2023
48ff3cf
fix syntax error from previous commit (catchmentCN.F90)
gmao-rreichle Oct 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ module GEOS_CatchCNCLM40GridCompMod
use CATCHMENT_CN_MODEL
use compute_rc_mod
use CN_DriverMod
USE STIEGLITZSNOW, ONLY : &
snow_albedo, StieglitzSnow_calc_tpsnow, N_CONSTIT, &

USE STIEGLITZSNOW, ONLY : &
StieglitzSnow_snow_albedo, &
StieglitzSnow_calc_tpsnow, &
N_CONSTIT, &
NUM_DUDP, NUM_DUSV, NUM_DUWT, NUM_DUSD, &
NUM_BCDP, NUM_BCSV, NUM_BCWT, NUM_BCSD, &
NUM_OCDP, NUM_OCSV, NUM_OCWT, NUM_OCSD, &
Expand All @@ -48,10 +51,10 @@ module GEOS_CatchCNCLM40GridCompMod
USE CATCH_CONSTANTS, ONLY : &
N_GT => CATCH_N_GT, &
N_SNOW => CATCH_N_SNOW, &
RHOFS => CATCH_SNWALB_RHOFS, &
SNWALB_VISMAX => CATCH_SNWALB_VISMAX, &
SNWALB_NIRMAX => CATCH_SNWALB_NIRMAX, &
SLOPE => CATCH_SNWALB_SLOPE, &
RHOFS => CATCH_SNOW_RHOFS, &
SNWALB_VISMAX => CATCH_SNOW_VISMAX, &
SNWALB_NIRMAX => CATCH_SNOW_NIRMAX, &
SLOPE => CATCH_SNOW_SLOPE, &
PEATCLSM_POROS_THRESHOLD

USE clm_varpar, ONLY : &
Expand Down Expand Up @@ -2276,6 +2279,33 @@ subroutine SetServices ( GC, RC )
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'snow_frozen_fraction_layer_1' ,&
UNITS = '1' ,&
SHORT_NAME = 'FICE1' ,&
DIMS = MAPL_DimsTileOnly ,&
VLOCATION = MAPL_VLocationNone ,&
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'snow_frozen_fraction_layer_2' ,&
UNITS = '1' ,&
SHORT_NAME = 'FICE2' ,&
DIMS = MAPL_DimsTileOnly ,&
VLOCATION = MAPL_VLocationNone ,&
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'snow_frozen_fraction_layer_3' ,&
UNITS = '1' ,&
SHORT_NAME = 'FICE3' ,&
DIMS = MAPL_DimsTileOnly ,&
VLOCATION = MAPL_VLocationNone ,&
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'surface_emitted_longwave_flux',&
UNITS = 'W m-2' ,&
Expand Down Expand Up @@ -4700,6 +4730,9 @@ subroutine Driver ( RC )
real, dimension(:), pointer :: bflow
real, dimension(:), pointer :: runsurf
real, dimension(:), pointer :: smelt
real, dimension(:), pointer :: fice1
real, dimension(:), pointer :: fice2
real, dimension(:), pointer :: fice3
real, dimension(:), pointer :: accum
real, dimension(:), pointer :: hlwup
real, dimension(:), pointer :: swndsrf
Expand Down Expand Up @@ -4876,7 +4909,7 @@ subroutine Driver ( RC )
real,pointer,dimension(:) :: ALWX, BLWX
real,pointer,dimension(:) :: LHACC, SUMEV
real,pointer,dimension(:) :: fveg1, fveg2
real,pointer,dimension(:) :: FICE1
real,pointer,dimension(:) :: FICE1TMP
real,pointer,dimension(:) :: SLDTOT

! real*8,pointer,dimension(:) :: fsum
Expand All @@ -4885,6 +4918,7 @@ subroutine Driver ( RC )
real,pointer,dimension(:,:) :: wesnn
real,pointer,dimension(:,:) :: htsnnn
real,pointer,dimension(:,:) :: sndzn
real,pointer,dimension(:,:) :: ficesout
real,pointer,dimension(:,:) :: shsbt
real,pointer,dimension(:,:) :: dshsbt
real,pointer,dimension(:,:) :: evsbt
Expand Down Expand Up @@ -5347,6 +5381,9 @@ subroutine Driver ( RC )
call MAPL_GetPointer(EXPORT,BFLOW, 'BASEFLOW',ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,RUNSURF,'RUNSURF',ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,SMELT, 'SMELT' ,ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,FICE1, 'FICE1' ,ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,FICE2, 'FICE2' ,ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,FICE3, 'FICE3' ,ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,HLWUP, 'HLWUP' ,ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,SWNDSRF,'SWNDSRF',ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT,LWNDSRF,'LWNDSRF',ALLOC=.true.,RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -5629,10 +5666,12 @@ subroutine Driver ( RC )
! ALLOCATE LOCAL POINTERS
! --------------------------------------------------------------------------

allocate(GHTCNT (6,NTILES))
allocate(WESNN (3,NTILES))
allocate(HTSNNN (3,NTILES))
allocate(SNDZN (3,NTILES))
allocate(GHTCNT (N_GT, NTILES))
allocate(WESNN (N_SNOW,NTILES))
allocate(HTSNNN (N_SNOW,NTILES))
allocate(SNDZN (N_SNOW,NTILES))
allocate(FICESOUT(N_SNOW,NTILES))

allocate(TILEZERO (NTILES))
allocate(DZSF (NTILES))
allocate(SWNETFREE(NTILES))
Expand Down Expand Up @@ -5697,8 +5736,8 @@ subroutine Driver ( RC )
allocate(SUMEV (NTILES))
allocate(fveg1 (NTILES))
allocate(fveg2 (NTILES))
allocate(FICE1 (NTILES))
allocate(SLDTOT (NTILES))
allocate(FICE1TMP (NTILES))
allocate(SLDTOT (NTILES)) ! total solid precip
allocate(FSW_CHANGE(NTILES))

allocate(SHSBT (NTILES,NUM_SUBTILES))
Expand Down Expand Up @@ -6644,10 +6683,10 @@ subroutine Driver ( RC )
ALBVR, ALBNR, ALBVF, ALBNF, MODIS_SCALE=.TRUE. ) ! instantaneous snow-free albedos on tiles


call STIEGLITZSNOW_CALC_TPSNOW(NTILES, HTSNNN(1,:), WESNN(1,:), TPSN1OUT1, FICE1)
call STIEGLITZSNOW_CALC_TPSNOW(NTILES, HTSNNN(1,:), WESNN(1,:), TPSN1OUT1, FICE1TMP )
TPSN1OUT1 = TPSN1OUT1 + Tzero

call SNOW_ALBEDO(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG1, LAI1, ZTH, &
call StieglitzSnow_snow_albedo(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG1, LAI1, ZTH, &
RHOFS, &
SNWALB_VISMAX, SNWALB_NIRMAX, SLOPE, &
WESNN, HTSNNN, SNDZN, &
Expand All @@ -6660,7 +6699,7 @@ subroutine Driver ( RC )
ALBVR_tmp, ALBNR_tmp, ALBVF_tmp, ALBNF_tmp, MODIS_SCALE=.TRUE. ) ! instantaneous snow-free albedos on tiles


call SNOW_ALBEDO(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG2, LAI2, ZTH, &
call StieglitzSnow_snow_albedo(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG2, LAI2, ZTH, &
RHOFS, &
SNWALB_VISMAX, SNWALB_NIRMAX, SLOPE, &
WESNN, HTSNNN, SNDZN, &
Expand Down Expand Up @@ -7264,7 +7303,7 @@ subroutine Driver ( RC )
TSURF ,&
SHSNOW1, AVETSNOW1, WAT10CM1, WATSOI1, ICESOI1 ,&
LHSNOW1, LWUPSNOW1, LWDNSNOW1, NETSWSNOW ,&
TCSORIG1, TPSN1IN1, TPSN1OUT1, FSW_CHANGE ,&
TCSORIG1, TPSN1IN1, TPSN1OUT1, FSW_CHANGE, FICESOUT ,&
TC1_0=TC1_0, TC2_0=TC2_0, TC4_0=TC4_0 ,&
QA1_0=QA1_0, QA2_0=QA2_0, QA4_0=QA4_0 ,&
RCONSTIT=RCONSTIT, RMELT=RMELT, TOTDEPOS=TOTDEPOS, LHACC=LHACC)
Expand Down Expand Up @@ -7326,10 +7365,10 @@ subroutine Driver ( RC )
ALBVR, ALBNR, ALBVF, ALBNF, MODIS_SCALE=.TRUE. ) ! instantaneous snow-free albedos on tiles


call STIEGLITZSNOW_CALC_TPSNOW(NTILES, HTSNNN(1,:), WESNN(1,:), TPSN1OUT1, FICE1)
call STIEGLITZSNOW_CALC_TPSNOW(NTILES, HTSNNN(1,:), WESNN(1,:), TPSN1OUT1, FICE1TMP )
TPSN1OUT1 = TPSN1OUT1 + Tzero

call SNOW_ALBEDO(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG1, LAI1, ZTH, &
call StieglitzSnow_snow_albedo(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG1, LAI1, ZTH, &
RHOFS, &
SNWALB_VISMAX, SNWALB_NIRMAX, SLOPE, &
WESNN, HTSNNN, SNDZN, &
Expand All @@ -7342,7 +7381,7 @@ subroutine Driver ( RC )
ALBVR_tmp, ALBNR_tmp, ALBVF_tmp, ALBNF_tmp, MODIS_SCALE=.TRUE. ) ! instantaneous snow-free albedos on tiles


call SNOW_ALBEDO(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG2, LAI2, ZTH, &
call StieglitzSnow_snow_albedo(NTILES,N_snow, catchcn_internal%N_CONST_LAND4SNWALB, VEG2, LAI2, ZTH, &
RHOFS, &
SNWALB_VISMAX, SNWALB_NIRMAX, SLOPE, &
WESNN, HTSNNN, SNDZN, &
Expand Down Expand Up @@ -7476,6 +7515,10 @@ subroutine Driver ( RC )
if(associated(SNOMAS)) SNOMAS = WESNN (1,:) + WESNN (2,:) + WESNN (3,:)
if(associated(SNOWDP)) SNOWDP = SNDZN (1,:) + SNDZN (2,:) + SNDZN (3,:)

if(associated(FICE1 )) FICE1 = max( min( FICESOUT(1,:),1.0 ), 0.0 )
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)
Expand Down Expand Up @@ -7591,6 +7634,7 @@ subroutine Driver ( RC )
deallocate(WESNN )
deallocate(HTSNNN )
deallocate(SNDZN )
deallocate(FICESOUT )
deallocate(TILEZERO )
deallocate(DZSF )
deallocate(SWNETFREE)
Expand Down Expand Up @@ -7679,7 +7723,7 @@ subroutine Driver ( RC )
deallocate(RCONSTIT )
deallocate(TOTDEPOS )
deallocate(RMELT )
deallocate(FICE1 )
deallocate(FICE1TMP )
deallocate(SLDTOT )
deallocate(FSW_CHANGE)
deallocate( btran )
Expand Down Expand Up @@ -8147,7 +8191,7 @@ subroutine RUN0(gc, import, export, clock, rc)
wesnn(1,:) = wesnn1
wesnn(2,:) = wesnn2
wesnn(3,:) = wesnn3
call StieglitzSnow_calc_asnow(3, ntiles, wesnn, asnow)
call StieglitzSnow_calc_asnow(N_snow, ntiles, wesnn, asnow)

EMIS = fveg1*(EMSVEG(NINT(VEG1)) + (EMSBARESOIL - EMSVEG(NINT(VEG1)))*exp(-LAI1)) + &
fveg2*(EMSVEG(NINT(VEG2)) + (EMSBARESOIL - EMSVEG(NINT(VEG2)))*exp(-LAI2))
Expand Down
Loading