From fcab4dca90b65168dcecb93b2974ab45b149d453 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 2 Sep 2021 18:25:28 +0000 Subject: [PATCH] Add read of land albedo fields. Add diagnostic print for albedo fields before and after call to sfccycle. Fixes #549. --- sorc/global_cycle.fd/cycle.f90 | 35 +++++++++++++++++++--- sorc/global_cycle.fd/read_write_data.f90 | 38 +++++++++++++++++++++++- ush/global_cycle_driver.sh | 2 ++ 3 files changed, 70 insertions(+), 5 deletions(-) diff --git a/sorc/global_cycle.fd/cycle.f90 b/sorc/global_cycle.fd/cycle.f90 index 274eab6da..d416c79f4 100644 --- a/sorc/global_cycle.fd/cycle.f90 +++ b/sorc/global_cycle.fd/cycle.f90 @@ -360,6 +360,8 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, & REAL, ALLOCATABLE :: STC_BCK(:,:), SMC_BCK(:,:), SLC_BCK(:,:) REAL, ALLOCATABLE :: SLIFCS_FG(:), LAND_FRAC(:) REAL, ALLOCATABLE :: ZORLI(:), ZORLL(:), ZORLO(:) + REAL, ALLOCATABLE :: ALBDIFNIR_LND(:), ALBDIFVIS_LND(:), ALBDIRNIR_LND(:) + REAL, ALLOCATABLE :: ALBDIRVIS_LND(:) INTEGER, ALLOCATABLE :: SOILSNOW_FG_MASK(:), SOILSNOW_MASK(:) TYPE(NSST_DATA) :: NSST @@ -397,6 +399,10 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, & ALLOCATE(ZORLI(LENSFC)) ALLOCATE(ZORLL(LENSFC)) ALLOCATE(ZORLO(LENSFC)) + ALLOCATE(ALBDIFNIR_LND(LENSFC)) + ALLOCATE(ALBDIFVIS_LND(LENSFC)) + ALLOCATE(ALBDIRNIR_LND(LENSFC)) + ALLOCATE(ALBDIRVIS_LND(LENSFC)) ENDIF !-------------------------------------------------------------------------------- @@ -469,7 +475,8 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, & SITFCS,TPRCP,SRFLAG,SWDFCS,VMNFCS, & VMXFCS,SLCFCS,SLPFCS,ABSFCS,T2M,Q2M, & SLMASK,ZSOIL,LSOIL,LENSFC,DO_NSST,NSST, & - ZORLI,ZORLL,ZORLO) + ZORLI,ZORLL,ZORLO,ALBDIFNIR_LND,ALBDIFVIS_LND, & + ALBDIRNIR_LND,ALBDIRVIS_LND) ELSE CALL READ_DATA(TSFFCS,SMCFCS,SNOFCS,STCFCS,TG3FCS,ZORFCS, & CVFCS,CVBFCS,CVTFCS,ALBFCS,SLIFCS, & @@ -518,7 +525,9 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, & enddo if (frac_grid) then - icheck=98 +! icheck=98 ! this is a partial land point. +! icheck=4 ! this is all open water + icheck=97 ! this is all land print*,'check point land frac, ice c ',land_frac(icheck),sicfcs(icheck) txl = land_frac(icheck) ! land fraction wfrac = 1.0 - txl ! ocean fraction @@ -528,6 +537,14 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, & print*,'check point zorli,zorlo,zorll,zorfcs ',zorli(icheck), & zorlo(icheck),zorll(icheck),zorfcs(icheck) print*,'check point computed zorfcs ',exp(txl*log(zorll(icheck)) + txi*log(zorli(icheck)) + txo*log(zorlo(icheck))) + print*,'check point ALBDIFNIR_LND ALNWF ', ALBDIFNIR_LND(icheck), & + ALBFCS(icheck,4) + print*,'check point ALBDIFVIS_LND ALVWF ', ALBDIFVIS_LND(icheck), & + ALBFCS(icheck,2) + print*,'check point ALBDIRNIR_LND ALNSF ', ALBDIRNIR_LND(icheck), & + ALBFCS(icheck,3) + print*,'check point ALBDIRVIS_LND ALVSF ', ALBDIRVIS_LND(icheck), & + ALBFCS(icheck,1) endif @@ -609,13 +626,23 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, & ! update based on new or melted ice. txl = land_frac(i) ! land fraction wfrac = 1.0 - txl ! ocean fraction - print*,'in loop i ',i - print*,'in loop sic ',sicfcs(i) +! print*,'in loop i ',i +! print*,'in loop sic ',sicfcs(i) txi = sicfcs(i) * wfrac ! txi = ice fraction wrt whole cell txo = max(0.0, wfrac-txi) ! txo = open water fraction zorfcs(i)=exp(txl*log(zorll(i)) + txi*log(zorli(i)) + txo*log(zorlo(i))) ENDDO print*,'check after sfccycle zorll,zorli,zorlo,zorfcs ',zorll(icheck),zorli(icheck),zorlo(icheck),zorfcs(icheck) +! after sfccycle, albedo will be updated at land, so need to update the "lnd" +! variable. what about sea ice? + print*,'check after sfccycle ALBDIFNIR_LND ALNWF ', ALBDIFNIR_LND(icheck), & + ALBFCS(icheck,4) + print*,'check after sfccycle ALBDIFVIS_LND ALVWF ', ALBDIFVIS_LND(icheck), & + ALBFCS(icheck,2) + print*,'check after sfccycle ALBDIRNIR_LND ALNSF ', ALBDIRNIR_LND(icheck), & + ALBFCS(icheck,3) + print*,'check after sfccycle ALBDIRVIS_LND ALVSF ', ALBDIRVIS_LND(icheck), & + ALBFCS(icheck,1) DEALLOCATE(LAND_FRAC) ENDIF diff --git a/sorc/global_cycle.fd/read_write_data.f90 b/sorc/global_cycle.fd/read_write_data.f90 index 0f360e9dc..b220c6a8b 100644 --- a/sorc/global_cycle.fd/read_write_data.f90 +++ b/sorc/global_cycle.fd/read_write_data.f90 @@ -1259,7 +1259,9 @@ SUBROUTINE READ_DATA(TSFFCS,SMCFCS,SNOFCS,STCFCS, & VMNFCS,VMXFCS,SLCFCS, & SLPFCS,ABSFCS,T2M,Q2M,SLMASK, & ZSOIL,LSOIL,LENSFC,DO_NSST,NSST, & - ZORLI,ZORLL,ZORLO) + ZORLI,ZORLL,ZORLO,ALBDIFNIR_LND, & + ALBDIFVIS_LND, ALBDIRNIR_LND, & + ALBDIRVIS_LND) USE MPI IMPLICIT NONE @@ -1268,6 +1270,8 @@ SUBROUTINE READ_DATA(TSFFCS,SMCFCS,SNOFCS,STCFCS, & LOGICAL, INTENT(IN) :: DO_NSST + REAL, INTENT(OUT), OPTIONAL :: ALBDIFNIR_LND(LENSFC), ALBDIFVIS_LND(LENSFC) + REAL, INTENT(OUT), OPTIONAL :: ALBDIRNIR_LND(LENSFC), ALBDIRVIS_LND(LENSFC) REAL, INTENT(OUT), OPTIONAL :: ZORLI(LENSFC), ZORLL(LENSFC) REAL, INTENT(OUT), OPTIONAL :: ZORLO(LENSFC) REAL, INTENT(OUT) :: CVFCS(LENSFC), CVBFCS(LENSFC) @@ -1542,6 +1546,38 @@ SUBROUTINE READ_DATA(TSFFCS,SMCFCS,SNOFCS,STCFCS, & ZORLO = RESHAPE(DUMMY, (/LENSFC/)) ENDIF + IF(PRESENT(ALBDIFNIR_LND)) THEN + ERROR=NF90_INQ_VARID(NCID, "albdifnir_lnd", ID_VAR) + CALL NETCDF_ERR(ERROR, 'READING albdifnir_lnd ID' ) + ERROR=NF90_GET_VAR(NCID, ID_VAR, dummy) + CALL NETCDF_ERR(ERROR, 'READING albdifnir_lnd' ) + albdifnir_lnd = RESHAPE(DUMMY, (/LENSFC/)) + ENDIF + + IF(PRESENT(ALBDIFVIS_LND)) THEN + ERROR=NF90_INQ_VARID(NCID, "albdifvis_lnd", ID_VAR) + CALL NETCDF_ERR(ERROR, 'READING albdifvis_lnd ID' ) + ERROR=NF90_GET_VAR(NCID, ID_VAR, dummy) + CALL NETCDF_ERR(ERROR, 'READING albdifvis_lnd' ) + albdifvis_lnd = RESHAPE(DUMMY, (/LENSFC/)) + ENDIF + + IF(PRESENT(ALBDIRVIS_LND)) THEN + ERROR=NF90_INQ_VARID(NCID, "albdirvis_lnd", ID_VAR) + CALL NETCDF_ERR(ERROR, 'READING albdirvis_lnd ID' ) + ERROR=NF90_GET_VAR(NCID, ID_VAR, dummy) + CALL NETCDF_ERR(ERROR, 'READING albdirvis_lnd' ) + albdirvis_lnd = RESHAPE(DUMMY, (/LENSFC/)) + ENDIF + + IF(PRESENT(ALBDIRNIR_LND)) THEN + ERROR=NF90_INQ_VARID(NCID, "albdirnir_lnd", ID_VAR) + CALL NETCDF_ERR(ERROR, 'READING albdirnir_lnd ID' ) + ERROR=NF90_GET_VAR(NCID, ID_VAR, dummy) + CALL NETCDF_ERR(ERROR, 'READING albdirnir_lnd' ) + albdirnir_lnd = RESHAPE(DUMMY, (/LENSFC/)) + ENDIF + NSST_READ : IF(DO_NSST) THEN PRINT* diff --git a/ush/global_cycle_driver.sh b/ush/global_cycle_driver.sh index d7e2b6c50..537d7bcb2 100755 --- a/ush/global_cycle_driver.sh +++ b/ush/global_cycle_driver.sh @@ -72,6 +72,7 @@ mkdir -p $DATA for n in $(seq 1 $ntiles); do # ln -fs $COMIN/$PDY.${cyc}0000.sfc_data.tile${n}.nc $DATA/fnbgsi.00$n +# on dell ln -fs /gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/global_cycle_fraction/input_data.fractional/cpld_control/RESTART/sfc_data.tile${n}.nc $DATA/fnbgsi.00$n ln -fs /scratch1/NCEPDEV/da/George.Gayno/ufs_utils.git/global_cycle_fraction/input_data.fractional/cpld_control/RESTART/sfc_data.tile${n}.nc $DATA/fnbgsi.00$n ln -fs $COMOUT/$PDY.${cyc}0000.sfcanl_data.tile${n}.nc $DATA/fnbgso.00$n @@ -79,6 +80,7 @@ for n in $(seq 1 $ntiles); do ln -fs $FIXfv3/C${CRES}/C${CRES}_grid.tile${n}.nc $DATA/fngrid.00$n # ln -fs $FIXfv3/C${CRES}/C${CRES}_oro_data.tile${n}.nc $DATA/fnorog.00$n +# on dell ln -fs /gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/global_cycle_fraction/input_data.fractional/C96_L64.mx100_frac/oro_data.tile${n}.nc $DATA/fnorog.00$n ln -fs /scratch1/NCEPDEV/da/George.Gayno/ufs_utils.git/global_cycle_fraction/input_data.fractional/C96_L64.mx100_frac/oro_data.tile${n}.nc $DATA/fnorog.00$n done