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 updating of soil moisture and soil temperature for Noah-MP to global_cycle #834

Merged
merged 18 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
583029e
write out stc analysis.
ClaraDraper-NOAA Jun 16, 2023
9c7106b
First pass ay applying SMC increments.
ClaraDraper-NOAA Jun 20, 2023
c2b8d7d
Add SMC and STC for Noah-MP, placeholders for Noah-MP model physics.
ClaraDraper-NOAA Jun 21, 2023
b4e70d0
removed redundant check on smc for applying soil increments
ClaraDraper-NOAA Jun 22, 2023
de1cf7f
Set upd_smc to false to match previous code.
ClaraDraper-NOAA Jun 22, 2023
e142299
updated rt.sh for my tests.
ClaraDraper-NOAA Jun 22, 2023
9f73bd7
Merge branch 'develop' into feature/AddNoahmpIncr
ClaraDraper-NOAA Jul 7, 2023
4c4fd98
Removed LSM option from namelist, to avoid duplication with IS_NOAHMP.
ClaraDraper-NOAA Jul 7, 2023
08222de
replaced C768.lndincsoil.sh test with C192.lndincsoilnoahmp.sh test f…
ClaraDraper-NOAA Jul 7, 2023
ce59491
replaced C768.lndincsoil.sh test with C192.lndincsoilnoahmp.sh test f…
ClaraDraper-NOAA Jul 7, 2023
7c3d6a5
Merge branch 'feature/AddNoahmpIncr' of https://github.com/NOAA-PSL/U…
ClaraDraper-NOAA Jul 7, 2023
3bf66a1
clean-up for pull request.
ClaraDraper-NOAA Jul 7, 2023
dc53476
Cleaning up C192 test script, in response to George's comments.
ClaraDraper-NOAA Jul 10, 2023
4c29d30
George's updates to run tests outside hera.
ClaraDraper-NOAA Jul 10, 2023
2442d62
Changes to comments requested by George for Doxygen.
ClaraDraper-NOAA Jul 10, 2023
79917b1
Updates to unit test to successfully run the old test.
ClaraDraper-NOAA Jul 10, 2023
a190d01
George's script for WCOSS2 tests, and added descriptions for new Doxy…
ClaraDraper-NOAA Jul 11, 2023
abe5c94
Updated the unit test for global_cycle to Noah-MP case.
ClaraDraper-NOAA Jul 11, 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
GeorgeGayno-NOAA marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

#------------------------------------------------------------------
# Run global_cycle for a C768 case to test the ingest and
# application of soil temperature increments from the GSI.
# Run global_cycle for a C192 case to test the ingest and
# application of soil moisture and temperature increments
# from the GSI, into Noah-MP restarts.
# Compare output to a baseline set of files using the 'nccmp'
# utility.
#------------------------------------------------------------------
Expand All @@ -22,13 +23,9 @@ export CDATE=2019073000
export FHOUR=00
export DELTSFC=6

export CASE=C768
export CASE=C192

export COMIN=$HOMEreg/input_data
export FNTSFA=$COMIN/gdas.t00z.rtgssthr.grb
export FNSNOA=$COMIN/gdas.t00z.snogrb_t1534.3072.1536
export FNACNA=$COMIN/gdas.t00z.seaice.5min.blend.grb
export NST_FILE=$COMIN/gdas.t00z.dtfanl.nc
export COMIN=$HOMEreg/input_data_noahmp
GeorgeGayno-NOAA marked this conversation as resolved.
Show resolved Hide resolved

export LND_SOI_FILE=$COMIN/sfcincr_gsi

Expand All @@ -52,7 +49,7 @@ $BASE_GSM/ush/global_cycle_driver.sh
iret=$?
if [ $iret -ne 0 ]; then
set +x
echo "<<< C768 LANDINC SOILT CYCLE TEST FAILED. >>>"
echo "<<< C192 LANDINC SOIL NOAHMP CYCLE TEST FAILED. >>>"
exit $iret
fi

Expand All @@ -63,7 +60,7 @@ for files in *tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
$NCCMP -dmfqS $files $HOMEreg/baseline_data/c768.lndincsoil/$files
$NCCMP -dmfqS $files $HOMEreg/baseline_data/c192.lndincsoilnoahmp/$files
iret=$?
if [ $iret -ne 0 ]; then
test_failed=1
Expand All @@ -75,15 +72,15 @@ set +x
if [ $test_failed -ne 0 ]; then
echo
echo "*****************************************"
echo "<<< C768 LANDINC SOILT CYCLE TEST FAILED. >>>"
echo "<<< C192 LANDINC SOIL-NOAHP CYCLE TEST FAILED. >>>"
echo "*****************************************"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$BASE_GSM/reg_tests/update_baseline.sh $HOMEreg "c768.lndincsoil" $commit_num
$BASE_GSM/reg_tests/update_baseline.sh $HOMEreg "c192.lndincsoilnoahmp" $commit_num
fi
else
echo
echo "*****************************************"
echo "<<< C768 LANDINC SOILT CYCLE TEST PASSED. >>>"
echo "<<< C192 LANDINC SOIL-NOAHMP CYCLE TEST PASSED. >>>"
echo "*****************************************"
fi

Expand Down
4 changes: 2 additions & 2 deletions reg_tests/global_cycle/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ TEST1=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_C
LOG_FILE=consistency.log02
export DATA="${DATA_DIR}/test2"
export COMOUT=$DATA
TEST2=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c768.lndincsoil \
-o $LOG_FILE -e $LOG_FILE ./C768.lndincsoil.sh)
TEST2=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c192.lndincsoilnoahmp \
-o $LOG_FILE -e $LOG_FILE ./C192.lndincsoilnoahmp.sh)

LOG_FILE=consistency.log03
export DATA="${DATA_DIR}/test3"
Expand Down
4 changes: 2 additions & 2 deletions reg_tests/global_cycle/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ TEST1=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_C
LOG_FILE=consistency.log02
export DATA="${DATA_DIR}/test2"
export COMOUT=$DATA
TEST2=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c768.lndincsoil \
--partition=xjet -o $LOG_FILE -e $LOG_FILE ./C768.lndincsoil.sh)
TEST2=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c192.lndincsoilnoahmp \
--partition=xjet -o $LOG_FILE -e $LOG_FILE ./C192.lndincsoilnoahmp.sh)

LOG_FILE=consistency.log03
export DATA="${DATA_DIR}/test3"
Expand Down
4 changes: 2 additions & 2 deletions reg_tests/global_cycle/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ TEST1=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_C
LOG_FILE=consistency.log02
export DATA="${DATA_DIR}/test2"
export COMOUT=$DATA
TEST2=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c768.lndincsoil \
-o $LOG_FILE -e $LOG_FILE ./C768.lndincsoil.sh)
TEST2=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c192.lndincsoilnoahmp \
-o $LOG_FILE -e $LOG_FILE ./C192.lndincsoilnoahmp.sh)

LOG_FILE=consistency.log03
export DATA="${DATA_DIR}/test3"
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/global_cycle/driver.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TEST1=$(qsub -V -o ${LOG_FILE}01 -e ${LOG_FILE}01 -q $QUEUE -A $PROJECT_CODE -l
export DATA="${DATA_DIR}/test2"
export COMOUT=$DATA
TEST2=$(qsub -V -o ${LOG_FILE}02 -e ${LOG_FILE}02 -q $QUEUE -A $PROJECT_CODE -l walltime=00:05:00 \
-N c768.lndincsoil -l select=1:ncpus=12:mem=8GB $PWD/C768.lndincsoil.sh)
-N c192.lndincsoilnoahmp -l select=1:ncpus=12:mem=8GB $PWD/C192.lndincsoilnoahmp.sh)

export DATA="${DATA_DIR}/test3"
export COMOUT=$DATA
Expand Down
64 changes: 35 additions & 29 deletions sorc/global_cycle.fd/cycle.f90
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@
!! - IDIM,JDIM i/j dimension of a cubed-sphere tile.
!! - LUGB Unit number used in the sfccycle subprogram
!! to read input datasets.
!! Next four should match the gfs_physics_nml
!! - LSM Integer code for LSM (as in GFS_TYPES)
!! 1 - Noah
!! (note: added for land_da_adjust layers, however
!! sfcsub routine (and likely others) assume the noah lsm
!! - LSOIL Number of soil layers.
!! - IY,IM,ID,IH Year, month, day, and hour of initial state.
!! - FH Forecast hour
Expand Down Expand Up @@ -110,18 +105,18 @@ PROGRAM SFC_DRV
IMPLICIT NONE
!
CHARACTER(LEN=3) :: DONST
INTEGER :: IDIM, JDIM, LSM, LSOIL, LUGB, IY, IM, ID, IH, IALB
INTEGER :: IDIM, JDIM, LSOIL, LUGB, IY, IM, ID, IH, IALB
INTEGER :: ISOT, IVEGSRC, LENSFC, ZSEA1_MM, ZSEA2_MM, IERR
INTEGER :: NPROCS, MYRANK, NUM_THREADS, NUM_PARTHDS, MAX_TASKS
REAL :: FH, DELTSFC, ZSEA1, ZSEA2
LOGICAL :: USE_UFO, DO_NSST, DO_LNDINC, DO_SFCCYCLE
!
NAMELIST/NAMCYC/ IDIM,JDIM,LSM,LSOIL,LUGB,IY,IM,ID,IH,FH,&
NAMELIST/NAMCYC/ IDIM,JDIM,LSOIL,LUGB,IY,IM,ID,IH,FH,&
DELTSFC,IALB,USE_UFO,DONST, &
DO_SFCCYCLE,ISOT,IVEGSRC,ZSEA1_MM, &
ZSEA2_MM, MAX_TASKS, DO_LNDINC
!
DATA IDIM,JDIM,LSM,LSOIL/96,96,1,4/
DATA IDIM,JDIM,LSOIL/96,96,4/
DATA IY,IM,ID,IH,FH/1997,8,2,0,0./
DATA LUGB/51/, DELTSFC/0.0/, IALB/1/, MAX_TASKS/99999/
DATA ISOT/1/, IVEGSRC/2/, ZSEA1_MM/0/, ZSEA2_MM/0/
Expand Down Expand Up @@ -169,10 +164,10 @@ PROGRAM SFC_DRV
ENDIF

PRINT*
IF (MYRANK==0) PRINT*,"LUGB,IDIM,JDIM,LSM,ISOT,IVEGSRC,LSOIL,DELTSFC,IY,IM,ID,IH,FH: ", &
LUGB,IDIM,JDIM,LSM,ISOT,IVEGSRC,LSOIL,DELTSFC,IY,IM,ID,IH,FH
IF (MYRANK==0) PRINT*,"LUGB,IDIM,JDIM,ISOT,IVEGSRC,LSOIL,DELTSFC,IY,IM,ID,IH,FH: ", &
LUGB,IDIM,JDIM,ISOT,IVEGSRC,LSOIL,DELTSFC,IY,IM,ID,IH,FH

CALL SFCDRV(LUGB,IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
CALL SFCDRV(LUGB,IDIM,JDIM,LENSFC,LSOIL,DELTSFC, &
IY,IM,ID,IH,FH,IALB, &
USE_UFO,DO_NSST,DO_SFCCYCLE,DO_LNDINC, &
ZSEA1,ZSEA2,ISOT,IVEGSRC,MYRANK)
Expand Down Expand Up @@ -277,8 +272,6 @@ END PROGRAM SFC_DRV
!! @param[in] IDIM 'i' dimension of the cubed-sphere tile
!! @param[in] JDIM 'j' dimension of the cubed-sphere tile
!! @param[in] LENSFC Total numberof points for the cubed-sphere tile
!! @param[in] LSM Integer code for the land surface model
!! 1 - Noah
!! @param[in] LSOIL Number of soil layers
!! @param[in] DELTSFC Cycling frequency in hours
!! @param[in] IY Year of initial state
Expand All @@ -301,7 +294,7 @@ END PROGRAM SFC_DRV
!! @param[in] IVEGSRC Use IGBP vegetation type when '1'. Use SIB when '2'.
!! @param[in] MYRANK MPI rank number
!! @author Mark Iredell, George Gayno
SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LENSFC,LSOIL,DELTSFC, &
IY,IM,ID,IH,FH,IALB, &
USE_UFO,DO_NSST,DO_SFCCYCLE,DO_LNDINC,&
ZSEA1,ZSEA2,ISOT,IVEGSRC,MYRANK)
Expand All @@ -312,12 +305,13 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
USE LAND_INCREMENTS, ONLY: ADD_INCREMENT_SOIL, &
ADD_INCREMENT_SNOW, &
CALCULATE_LANDINC_MASK, &
APPLY_LAND_DA_ADJUSTMENTS_STC, &
APPLY_LAND_DA_ADJUSTMENTS_SND
APPLY_LAND_DA_ADJUSTMENTS_SOIL, &
APPLY_LAND_DA_ADJUSTMENTS_SND, &
LSM_NOAH, LSM_NOAHMP

IMPLICIT NONE

INTEGER, INTENT(IN) :: IDIM, JDIM, LSM,LENSFC, LSOIL, IALB
INTEGER, INTENT(IN) :: IDIM, JDIM, LENSFC, LSOIL, IALB
INTEGER, INTENT(IN) :: LUGB, IY, IM, ID, IH
INTEGER, INTENT(IN) :: ISOT, IVEGSRC, MYRANK

Expand All @@ -339,7 +333,8 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
INTEGER :: IDUM(IDIM,JDIM)
integer :: num_parthds, num_threads

LOGICAL :: IS_NOAHMP=.FALSE.
LOGICAL :: IS_NOAHMP
INTEGER :: LSM

real(kind=kind_io8) :: min_ice(lensfc)

Expand Down Expand Up @@ -377,8 +372,10 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
real, dimension(idim,jdim) :: tf_clm,tf_trd,sal_clm
real, dimension(lensfc) :: tf_clm_tile,tf_trd_tile,sal_clm_tile
INTEGER :: veg_type_landice
INTEGER, DIMENSION(LENSFC) :: STC_UPDATED, SLC_UPDATED

LOGICAL :: FILE_EXISTS, DO_SOI_INC, DO_SNO_INC

!--------------------------------------------------------------------------------
! NST_FILE is the path/name of the gaussian GSI file which contains NSST
! increments.
Expand Down Expand Up @@ -489,6 +486,12 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
ABSFCS=ABSFCS,T2M=T2M ,Q2M=Q2M ,SLMASK=SLMASK, &
ZSOIL=ZSOIL, NSST=NSST)

IF (IS_NOAHMP) THEN
LSM=LSM_NOAHMP
ELSE
LSM=LSM_NOAH
ENDIF

IF (USE_UFO) THEN
PRINT*
PRINT*,'USE UNFILTERED OROGRAPHY.'
Expand Down Expand Up @@ -516,7 +519,7 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &

! CALCULATE MASK FOR LAND INCREMENTS
IF (DO_LNDINC) &
CALL CALCULATE_LANDINC_MASK(SLCFCS(:,1),SWEFCS, VETFCS, &
CALL CALCULATE_LANDINC_MASK(SMCFCS(:,1),SWEFCS, VETFCS, &
LENSFC,VEG_TYPE_LANDICE, LANDINC_MASK)

!--------------------------------------------------------------------------------
Expand Down Expand Up @@ -654,7 +657,7 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
LANDINC_MASK_FG = LANDINC_MASK

IF (DO_SFCCYCLE .OR. DO_SNO_INC) THEN
CALL CALCULATE_LANDINC_MASK(SLCFCS(:,1),SWEFCS, VETFCS, LENSFC, &
CALL CALCULATE_LANDINC_MASK(SMCFCS(:,1),SWEFCS, VETFCS, LENSFC, &
VEG_TYPE_LANDICE, LANDINC_MASK )
ENDIF

Expand All @@ -681,18 +684,21 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &

! store background states
STC_BCK = STCFCS
SMC_BCK = SMCFCS ! not used yet.
SLC_BCK = SLCFCS ! not used yet.
SMC_BCK = SMCFCS
SLC_BCK = SLCFCS

CALL ADD_INCREMENT_SOIL(RLA,RLO,STCFCS,LANDINC_MASK,LANDINC_MASK_FG, &
LENSFC,LSOIL,IDIM,JDIM, MYRANK)
! below updates [STC/SMC/STC]FCS to hold the analysis
CALL ADD_INCREMENT_SOIL(RLA,RLO,STCFCS,SMCFCS,SLCFCS,STC_UPDATED, SLC_UPDATED, &
LANDINC_MASK,LANDINC_MASK_FG,LENSFC,LSOIL,IDIM,JDIM,LSM,MYRANK)

!--------------------------------------------------------------------------------
! make any necessary adjustments to dependent variables
!--------------------------------------------------------------------------------

CALL APPLY_LAND_DA_ADJUSTMENTS_STC(LSM, ISOT, IVEGSRC,LENSFC, LSOIL, &
SOTFCS, LANDINC_MASK_FG, STC_BCK, STCFCS, SMCFCS, SLCFCS)

CALL APPLY_LAND_DA_ADJUSTMENTS_SOIL(LSM, ISOT, IVEGSRC,LENSFC, LSOIL, &
SOTFCS, LANDINC_MASK_FG, STC_BCK, STCFCS, SMCFCS, SLCFCS, STC_UPDATED, &
SLC_UPDATED,ZSOIL)

ENDIF ! soil increments

Expand All @@ -715,12 +721,12 @@ SUBROUTINE SFCDRV(LUGB, IDIM,JDIM,LSM,LENSFC,LSOIL,DELTSFC, &
! WRITE OUT UPDATED SURFACE DATA ON THE CUBED-SPHERE TILE.
!--------------------------------------------------------------------------------

IF (IS_NOAHMP) THEN
IF (LSM==LSM_NOAHMP) THEN

CALL WRITE_DATA(LENSFC,IDIM,JDIM,LSOIL,DO_NSST,NSST,VEGFCS=VEGFCS, &
SLCFCS=SLCFCS,SMCFCS=SMCFCS)
SLCFCS=SLCFCS,SMCFCS=SMCFCS,STCFCS=STCFCS)

ELSE
ELSEIF (LSM==LSM_NOAH) THEN

CALL WRITE_DATA(LENSFC,IDIM,JDIM,LSOIL, &
DO_NSST,NSST,SLIFCS=SLIFCS,TSFFCS=TSFFCS,VEGFCS=VEGFCS, &
Expand Down
Loading