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

Output fractions of each vegetation/soil type category #748

Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
086143c
Baseline initial routines to process fractional veg/soil type.
GeorgeGayno-NOAA Oct 28, 2022
0a8f4fa
Begin clean up of output routine.
GeorgeGayno-NOAA Oct 28, 2022
b5e90be
More cleanup to output routine.
GeorgeGayno-NOAA Oct 28, 2022
e90969d
Some cleanup to new search routine.
GeorgeGayno-NOAA Oct 31, 2022
6b2834a
Some cleanup to interp2.
GeorgeGayno-NOAA Oct 31, 2022
46db839
More interp2 cleanup.
GeorgeGayno-NOAA Oct 31, 2022
cae15a1
More cleanup to interp2 and output2.
GeorgeGayno-NOAA Oct 31, 2022
2c8161a
Add control flag for processing category percentages.
GeorgeGayno-NOAA Oct 31, 2022
3e147b5
Add logic to turn off the landice adjustments when
GeorgeGayno-NOAA Nov 1, 2022
4adcb64
Pass in flag to tell program to output dominate category
GeorgeGayno-NOAA Nov 2, 2022
d99116c
Add computation and output of dominate category.
GeorgeGayno-NOAA Nov 14, 2022
bb91f34
Add output of water category.
GeorgeGayno-NOAA Nov 14, 2022
cc929a8
Update logic to work with fractional land/non-land grids.
GeorgeGayno-NOAA Nov 15, 2022
4cfe72e
Read water flag from file.
GeorgeGayno-NOAA Nov 15, 2022
7dc9416
Update wcoss2 driver script comments.
GeorgeGayno-NOAA Nov 16, 2022
933af8b
Simplify the file unit numbers in output2.f90
GeorgeGayno-NOAA Nov 16, 2022
33cefde
Deallocate unneeded memory as soon as possible in
GeorgeGayno-NOAA Nov 17, 2022
86f97df
Simplify output2 by adding subroutine to do file write.
GeorgeGayno-NOAA Nov 21, 2022
d5a349f
Rename output2.f90 to a more descriptive name.
GeorgeGayno-NOAA Nov 21, 2022
28e70e7
Cleanup and rename search routine. More cleanup to output
GeorgeGayno-NOAA Nov 21, 2022
d90eb60
Fix error in CMakeLists.txt.
GeorgeGayno-NOAA Nov 21, 2022
209f0b1
Rename the interpolation routine to something more descriptive.
GeorgeGayno-NOAA Nov 29, 2022
14adb2a
Updates for new routine name.
GeorgeGayno-NOAA Nov 29, 2022
8e75823
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Dec 1, 2022
43a405e
Add fractional grid logical flag to the sfc_climo_gen
GeorgeGayno-NOAA Dec 1, 2022
1b6dbcb
Clean up some comments in program_setup.f90
GeorgeGayno-NOAA Dec 1, 2022
1268330
Some cleanup to model_grid.F90.
GeorgeGayno-NOAA Dec 1, 2022
38c4519
Adjust some print statements in driver.F90
GeorgeGayno-NOAA Dec 1, 2022
f443ca4
Fix doxygen in output_frac_cats.F90
GeorgeGayno-NOAA Dec 1, 2022
bb7492e
Adjust comments in interp.F90.
GeorgeGayno-NOAA Dec 1, 2022
dcf39af
Adjust comments in interp_frac_cats.F90
GeorgeGayno-NOAA Dec 1, 2022
face5fc
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Dec 1, 2022
2719663
Update 'readthedocs' for new option.
GeorgeGayno-NOAA Dec 7, 2022
1c25497
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Dec 7, 2022
0368ddd
More readthedocs updates.
GeorgeGayno-NOAA Dec 7, 2022
8366bc3
Update Hera build module to point to Gerhard's ESMF test
GeorgeGayno-NOAA Dec 9, 2022
9653179
Add comment for using bigmem nodes in Hera grid driver
GeorgeGayno-NOAA Dec 13, 2022
2437f46
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Dec 13, 2022
7323f7d
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Dec 19, 2022
116b79a
Update all grid scripts.
GeorgeGayno-NOAA Dec 19, 2022
cd4eb0f
Remove debugging flag.
GeorgeGayno-NOAA Dec 19, 2022
306cd43
Add unit test for namelist read routine.
GeorgeGayno-NOAA Dec 20, 2022
80603b3
Add newest namelist variable to new unit test.
GeorgeGayno-NOAA Dec 20, 2022
64a9bd0
Change definition of dominate category when processing
GeorgeGayno-NOAA Dec 21, 2022
b19b2f8
Point to original esmf library instead of my
GeorgeGayno-NOAA Dec 27, 2022
da92e02
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Dec 28, 2022
c63846a
Comment out write of 'sum' of each category record.
GeorgeGayno-NOAA Dec 28, 2022
f4dd2c9
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Jan 3, 2023
a5a9fe6
Remove unused 'missing' attribute from soil/veg files.
GeorgeGayno-NOAA Jan 6, 2023
01efea0
Add consistency test for new functionality.
GeorgeGayno-NOAA Jan 9, 2023
9a2f72c
Update Jet driver script for new consistency test.
GeorgeGayno-NOAA Jan 9, 2023
eccfe40
Update hera driver script for new consistency test.
GeorgeGayno-NOAA Jan 9, 2023
e0ab34c
Update wcoss2 driver script for new consistency test.
GeorgeGayno-NOAA Jan 9, 2023
17fa799
Revert to origin esmf version for Hera build.
GeorgeGayno-NOAA Jan 9, 2023
1d45655
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Jan 10, 2023
ff3f2e4
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Jan 19, 2023
cba2a38
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Jan 25, 2023
b483cc8
Minor updates the Hera grid driver script.
GeorgeGayno-NOAA Jan 30, 2023
534dd0b
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 2, 2023
d1be9fd
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 2, 2023
8ecba17
Fix spelling mistakes.
GeorgeGayno-NOAA Feb 6, 2023
085858f
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 6, 2023
71fc588
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 9, 2023
16c2bf9
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 16, 2023
05d0293
Revert cmake/mpexec.hera file.
GeorgeGayno-NOAA Feb 16, 2023
6d2b2d3
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 22, 2023
97c4cfa
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 24, 2023
92d78b6
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Feb 28, 2023
55c58b3
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Mar 2, 2023
8ba64d0
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Mar 8, 2023
c2edc45
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Mar 17, 2023
4b591f3
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Mar 20, 2023
300f909
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Mar 27, 2023
f527005
Merge branch 'develop' into feature/sfc_climo_gen.frac
GeorgeGayno-NOAA Apr 5, 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
4 changes: 4 additions & 0 deletions docs/source/ufs_utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,13 @@ Location of the source code: ./sorc/sfc_climo_gen.fd. Brief description of each

* driver.F90 - The main driver routine.
* interp.F90 - The interpolation driver routine. Reads the input source data and interpolates it to the model grid.
* interp_frac_cats.F90 - Same as interp.F90, but for computing the fraction of each soil and vegetation type category. (When namelist variable 'vegsoilt_frac' is true).
* model_grid.F90 - Defines the ESMF grid object for the model grid.
* output.f90 - Writes the output surface data to a NetCDF file. For regional grids, will output separate files with and without the halo.
* output_frac_cats.f90 - Same as output.f90, but for writing fractional soil and vegetation type. (When namelist variable 'vegsoilt_frac' is true).
* program_setup.f90 - Reads the namelist and sets up program execution.
* search.f90 - Replace undefined values on the model grid with a valid value at a nearby neighbor. Undefined values are typically associated with isolated islands where there is no source data.
* search_frac_cats.f90 - Same as search.f90, but for the fractional soil and vegetation type option. (When namelist variable 'vegsoilt_frac' is true).
* source_grid.F90 - Reads the grid specifications and land/sea mask for the source data. Sets up the ESMF grid object for the source grid.
* utils.f90 - Contains error handling utility routines.

Expand All @@ -512,6 +515,7 @@ Program execution is controlled via a namelist. The namelist variables are:
* maximum_snow_albedo_method - interpolation method for this field. Bilinear or conservative. Default is bilinear.
* snowfree_albedo_method - interpolation method for this field. Bilinear or conservative. Default is bilinear.
* vegetation_greenness_method - interpolation method for this field. Bilinear or conservative. Default is bilinear.
* vegsoilt_frac - When 'true', outputs the dominate soil and vegetation type, and the fraction of each category. When 'false', only outputs the dominate categories. Default is 'false'.

Program inputs and outputs
--------------------------
Expand Down
15 changes: 12 additions & 3 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
#SBATCH -o log.fv3_grid_driver
#SBATCH -e log.fv3_grid_driver
#SBATCH --nodes=1 --ntasks-per-node=24
##SBATCH --partition=bigmem
#SBATCH -q debug
#SBATCH -t 00:30:00
#SBATCH -t 00:20:00

#-----------------------------------------------------------------------
# Driver script to create a cubic-sphere based model grid on Hera.
Expand All @@ -23,8 +24,9 @@
# Note: The sfc_climo_gen program only runs with an
# mpi task count that is a multiple of six. This is
# an ESMF library requirement. Large grids may require
# tasks spread across multiple nodes. The orography code
# benefits from threads.
# tasks spread across multiple nodes or to be run on
# 'bigmem' nodes (#SBATCH --partition=bigmem). The
# orography code benefits from threads.
#
# To run, do the following:
#
Expand Down Expand Up @@ -74,9 +76,16 @@ module list

export gtype=uniform # 'uniform', 'stretch', 'nest',
# 'regional_gfdl', 'regional_esg'.

export make_gsl_orog=false # When 'true' will output 'oro' files for
# the GSL orographic drag suite.

export vegsoilt_frac='.false.' # When .false., output dominant soil and
# vegetation type category. When .true.,
# output fraction of each category and
# the dominant category. A Fortran logical,
# so include the dots.

export veg_type_src="modis.igbp.0.05" # Vegetation type data.
# For viirs-based vegetation type data, set to:
# 1) "viirs.igbp.0.1" for global 0.10-deg data
Expand Down
6 changes: 6 additions & 0 deletions driver_scripts/driver_grid.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ export gtype=uniform # 'uniform', 'stretch', 'nest',
export make_gsl_orog=false # When 'true' will output 'oro' files for
# the GSL orographic drag suite.

export vegsoilt_frac='.false.' # When true, outputs percent of each
# soil and veg type category and a
# dominant category. When false, only
# outputs the dominant category. A
# Fortran logical, so include the dots.

export veg_type_src="modis.igbp.0.05" # Vegetation type data.
# For viirs-based vegetation type data, set to:
# 1) "viirs.igbp.0.1" for global 0.10-deg data
Expand Down
6 changes: 6 additions & 0 deletions driver_scripts/driver_grid.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ export gtype=regional_esg # 'uniform', 'stretch', 'nest',
export make_gsl_orog=false # When 'true' will output 'oro' files for
# the GSL orographic drag suite.

export vegsoilt_frac='.false.' # When true, outputs percent of each
# soil and veg type category and a
# dominant category. When false, only
# outputs the dominant category. A
# Fortran logical, so include the dots.

export veg_type_src="modis.igbp.0.05" # Vegetation type data.
# For viirs-based vegetation type data, set to:
# 1) "viirs.igbp.0.1" for global 0.10-deg data
Expand Down
6 changes: 6 additions & 0 deletions driver_scripts/driver_grid.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ export gtype=regional_esg # 'uniform', 'stretch', 'nest',
export make_gsl_orog=false # When 'true' will output 'oro' files for
# the GSL orographic drag suite.

export vegsoilt_frac='.false.' # When true, outputs percent of each
# soil and veg type category and a
# dominant category. When false, only
# outputs the dominant category. A
# Fortran logical, so include the dots.

export veg_type_src="modis.igbp.0.05" # Vegetation type data.
# For viirs-based vegetation type data, set to:
# 1) "viirs.igbp.0.1" for global 0.10-deg data
Expand Down
19 changes: 14 additions & 5 deletions reg_tests/grid_gen/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,36 @@ TEST3=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_
-o $LOG_FILE3 -e $LOG_FILE3 ./gfdl.regional.sh)

#-----------------------------------------------------------------------------
# esg regional grid
# ESG regional grid (output dominant soil/vegetation type).
#-----------------------------------------------------------------------------

LOG_FILE4=${LOG_FILE}04
TEST4=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J esg.regional \
-o $LOG_FILE4 -e $LOG_FILE4 ./esg.regional.sh)

#-----------------------------------------------------------------------------
# Regional GSL gravity wave drag test.
# ESG regional grid (output percent of each soil and vegetation type and
# the dominant category).
#-----------------------------------------------------------------------------

LOG_FILE5=${LOG_FILE}05
TEST5=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J reg.gsl.gwd \
-o $LOG_FILE5 -e $LOG_FILE5 ./regional.gsl.gwd.sh)
TEST5=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J esg.regional.pct.cat \
-o $LOG_FILE5 -e $LOG_FILE5 ./esg.regional.pct.cat.sh)

#-----------------------------------------------------------------------------
# Regional GSL gravity wave drag test.
#-----------------------------------------------------------------------------

LOG_FILE6=${LOG_FILE}06
TEST6=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J reg.gsl.gwd \
-o $LOG_FILE6 -e $LOG_FILE6 ./regional.gsl.gwd.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

sbatch --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J grid_summary -o $LOG_FILE -e $LOG_FILE \
--open-mode=append -q $QUEUE -d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5 << EOF
--open-mode=append -q $QUEUE -d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6 << EOF
#!/bin/bash
grep -a '<<<' ${LOG_FILE}* > $SUM_FILE
EOF
19 changes: 14 additions & 5 deletions reg_tests/grid_gen/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,36 @@ TEST3=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_
--partition=xjet -o $LOG_FILE3 -e $LOG_FILE3 ./gfdl.regional.sh)

#-----------------------------------------------------------------------------
# ESG regional grid
# ESG regional grid (output dominant soil/vegetation type).
#-----------------------------------------------------------------------------

LOG_FILE4=${LOG_FILE}04
TEST4=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J esg.regional \
--partition=xjet -o $LOG_FILE4 -e $LOG_FILE4 ./esg.regional.sh)

#-----------------------------------------------------------------------------
# Regional GSL gravity wave drag.
# ESG regional grid (output percent of each soil and vegetation type and
# the dominant category).
#-----------------------------------------------------------------------------

LOG_FILE5=${LOG_FILE}05
TEST5=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J reg.gsl.gwd \
--partition=xjet -o $LOG_FILE5 -e $LOG_FILE5 ./regional.gsl.gwd.sh)
TEST5=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J esg.regional.pct.cat \
--partition=xjet -o $LOG_FILE5 -e $LOG_FILE5 ./esg.regional.pct.cat.sh)

#-----------------------------------------------------------------------------
# Regional GSL gravity wave drag.
#-----------------------------------------------------------------------------

LOG_FILE6=${LOG_FILE}06
TEST6=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:07:00 -A $PROJECT_CODE -q $QUEUE -J reg.gsl.gwd \
--partition=xjet -o $LOG_FILE6 -e $LOG_FILE6 ./regional.gsl.gwd.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

sbatch --partition=xjet --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J grid_summary -o $LOG_FILE -e $LOG_FILE \
-q $QUEUE -d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5 << EOF
-q $QUEUE -d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6 << EOF
#!/bin/bash
grep -a '<<<' ${LOG_FILE}* > $SUM_FILE
EOF
19 changes: 14 additions & 5 deletions reg_tests/grid_gen/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,36 @@ TEST3=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:10:00 -A $PROJECT_
-o $LOG_FILE3 -e $LOG_FILE3 ./gfdl.regional.sh)

#-----------------------------------------------------------------------------
# ESG regional grid
# ESG regional grid (output dominant soil/vegetation type).
#-----------------------------------------------------------------------------

LOG_FILE4=${LOG_FILE}04
TEST4=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J esg.regional \
-o $LOG_FILE4 -e $LOG_FILE4 ./esg.regional.sh)

#-----------------------------------------------------------------------------
# Regional grid with GSL gravity wave drag fields.
# ESG regional grid (output percent of each soil and vegetation type and
# the dominant category).
#-----------------------------------------------------------------------------

LOG_FILE5=${LOG_FILE}05
TEST5=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J reg.gsl.gwd \
-o $LOG_FILE5 -e $LOG_FILE5 ./regional.gsl.gwd.sh)
TEST5=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J esg.regional.pct.cat \
-o $LOG_FILE5 -e $LOG_FILE5 ./esg.regional.pct.cat.sh)

#-----------------------------------------------------------------------------
# Regional grid with GSL gravity wave drag fields.
#-----------------------------------------------------------------------------

LOG_FILE6=${LOG_FILE}06
TEST6=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J reg.gsl.gwd \
-o $LOG_FILE6 -e $LOG_FILE6 ./regional.gsl.gwd.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

sbatch --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J grid_summary -o $LOG_FILE -e $LOG_FILE \
-q $QUEUE -d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5 << EOF
-q $QUEUE -d afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6 << EOF
#!/bin/bash
grep -a '<<<' ${LOG_FILE}* > $SUM_FILE
EOF
15 changes: 12 additions & 3 deletions reg_tests/grid_gen/driver.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,36 @@ TEST3=$(qsub -V -o $LOG_FILE3 -e $LOG_FILE3 -q $QUEUE -A $PROJECT_CODE -l wallti
-N gfdl.regional -l select=1:ncpus=30:mem=40GB $PWD/gfdl.regional.sh)

#-----------------------------------------------------------------------------
# esg regional grid
# ESG regional grid (output dominant soil/vegetation type).
#-----------------------------------------------------------------------------

LOG_FILE4=${LOG_FILE}04
TEST4=$(qsub -V -o $LOG_FILE4 -e $LOG_FILE4 -q $QUEUE -A $PROJECT_CODE -l walltime=00:07:00 \
-N esg.regional -l select=1:ncpus=30:mem=40GB $PWD/esg.regional.sh)

#-----------------------------------------------------------------------------
# Regional GSL gravity wave drag test.
# ESG regional grid (output percent of each soil and vegetation type and
# the dominant category).
#-----------------------------------------------------------------------------

LOG_FILE5=${LOG_FILE}05
TEST5=$(qsub -V -o $LOG_FILE5 -e $LOG_FILE5 -q $QUEUE -A $PROJECT_CODE -l walltime=00:07:00 \
-N esg.regional.pct.cat -l select=1:ncpus=30:mem=40GB $PWD/esg.regional.pct.cat.sh)

#-----------------------------------------------------------------------------
# Regional GSL gravity wave drag test.
#-----------------------------------------------------------------------------

LOG_FILE6=${LOG_FILE}06
TEST6=$(qsub -V -o $LOG_FILE6 -e $LOG_FILE6 -q $QUEUE -A $PROJECT_CODE -l walltime=00:07:00 \
-N rsg.gsl.gwd -l select=1:ncpus=30:mem=40GB $PWD/regional.gsl.gwd.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

qsub -V -o ${LOG_FILE} -e ${LOG_FILE} -q $QUEUE -A $PROJECT_CODE -l walltime=00:02:00 \
-N grid_summary -l select=1:ncpus=1:mem=100MB -W depend=afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5 << EOF
-N grid_summary -l select=1:ncpus=1:mem=100MB -W depend=afterok:$TEST1:$TEST2:$TEST3:$TEST4:$TEST5:$TEST6 << EOF
#!/bin/bash
cd ${this_dir}
grep -a '<<<' ${LOG_FILE}* | grep -v echo > $SUM_FILE
Expand Down
75 changes: 75 additions & 0 deletions reg_tests/grid_gen/esg.regional.pct.cat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

#-----------------------------------------------------------------------
# Create a regional esg grid. Output dominant soil and vegetation
# categories and well as the percentage of each category.
# Compare output to a set of baseline files using the 'nccmp'
# utility. This script is run by the machine specific driver script.
#-----------------------------------------------------------------------

set -x

TEST_NAME="esg.regional.pct.cat"
export TEMP_DIR=${WORK_DIR}/${TEST_NAME}.work
export out_dir=${WORK_DIR}/${TEST_NAME}

export gtype=regional_esg
export target_lon=-97.5 # Center longitude of the highest resolution tile
export target_lat=35.5 # Center latitude of the highest resolution tile
export idim=1301 # Dimension of grid in 'i' direction
export jdim=600 # Dimension of grid in 'j' direction
export delx=0.0145 # Grid spacing in degrees in 'i' direction
export dely=0.0145 # Grid spacing in degrees in 'j' direction
export halo=3
export vegsoilt_frac=.true. # Output dominant soil/veg categories as well
# as the percentage of each category.

NCCMP=${NCCMP:-$(which nccmp)}

#-----------------------------------------------------------------------
# Start script.
#-----------------------------------------------------------------------

echo "Starting at: " `date`

$home_dir/ush/fv3gfs_driver_grid.sh

iret=$?
if [ $iret -ne 0 ]; then
set +x
echo "<<< ESG REGIONAL PERCENT CATEGORY TEST FAILED. <<<"
exit $iret
fi

echo "Ending at: " `date`

#-----------------------------------------------------------------------------
# Compare output to baseline set of data.
#-----------------------------------------------------------------------------

cd $out_dir/C3113

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
$NCCMP -dmfqS $files $HOMEreg/${TEST_NAME}/$files
iret=$?
if [ $iret -ne 0 ]; then
test_failed=1
fi
fi
done

set +x
if [ $test_failed -ne 0 ]; then
echo "<<< ESG REGIONAL PERCENT CATEGORY TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$home_dir/reg_tests/update_baseline.sh "${HOMEreg}/.." "${TEST_NAME}" $commit_num
fi
else
echo "<<< ESG REGIONAL PERCENT CATEGORY TEST PASSED. >>>"
fi

exit 0
3 changes: 3 additions & 0 deletions sorc/sfc_climo_gen.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

set(lib_src
interp.F90
interp_frac_cats.F90
model_grid.F90
output.f90
output_frac_cats.F90
program_setup.f90
search.f90
search_frac_cats.f90
source_grid.F90
utils.f90)

Expand Down
20 changes: 16 additions & 4 deletions sorc/sfc_climo_gen.fd/driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ program driver
!-------------------------------------------------------------------------

call define_source_grid(localpet, npets, input_vegetation_type_file)
method=ESMF_REGRIDMETHOD_NEAREST_STOD
call interp(localpet, method, input_vegetation_type_file)
if (fract_vegsoil_type) then
print*,'- WILL OUTPUT VEGETATION TYPE FRACTION AND DOMINANT CATEGORY.'
call interp_frac_cats(localpet, input_vegetation_type_file)
else
print*,'- WILL OUTPUT DOMINANT VEGETATION TYPE.'
method=ESMF_REGRIDMETHOD_NEAREST_STOD
call interp(localpet, method, input_vegetation_type_file)
endif
call source_grid_cleanup

! Snow free albedo
Expand Down Expand Up @@ -136,8 +142,14 @@ program driver

if (trim(input_soil_type_file) /= "NULL") then
call define_source_grid(localpet, npets, input_soil_type_file)
method=ESMF_REGRIDMETHOD_NEAREST_STOD
call interp(localpet, method, input_soil_type_file)
if (fract_vegsoil_type) then
print*,'- WILL OUTPUT SOIL TYPE FRACTION AND DOMINANT CATEGORY.'
call interp_frac_cats(localpet, input_soil_type_file)
else
print*,'- WILL OUTPUT DOMINANT SOIL TYPE.'
method=ESMF_REGRIDMETHOD_NEAREST_STOD
call interp(localpet, method, input_soil_type_file)
endif
call source_grid_cleanup
endif

Expand Down
Loading