|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +#----------------------------------------------------------------------- |
| 4 | +# |
| 5 | +# This script is run by the machine specific driver script. |
| 6 | +# |
| 7 | +# Set the following variables: |
| 8 | +# |
| 9 | +# res - Grid resolution. Example: 384 or 384.mx025. |
| 10 | +# |
| 11 | +# FIX_FV3 - Location of the pre-existing 'grid' and 'orography' |
| 12 | +# files. Defaults to ${BASE_DIR}/fix/orog/C${res}, where |
| 13 | +# BASE_DIR is the location of the checked out repository. |
| 14 | +# |
| 15 | +# The required files are: |
| 16 | +# |
| 17 | +# 'mosaic' file - C${res}_mosaic.nc (Note: 'res' without |
| 18 | +# the 'mx' extension.) |
| 19 | +# |
| 20 | +# 'grid' files - C${res}_grid.tile7.halo${HALO}.nc (regional grids). |
| 21 | +# C${res}_grid.tile[1-6].nc (global grids). |
| 22 | +# Note: 'res' without the 'mx' extension. |
| 23 | +# |
| 24 | +# 'orog' files - C${res}_oro_data.tile7.halo${HALO}.nc (regional grids). |
| 25 | +# C${res}_oro_data.tile[1-6].nc (global grids). |
| 26 | +# |
| 27 | +# GRIDTYPE - set to 'regional' for regional grids. Otherwise, |
| 28 | +# comment out. |
| 29 | +# |
| 30 | +# FIX_REG - For regional grids. Hold links to the 'grid' and 'orog' files |
| 31 | +# with names expected by the program. |
| 32 | +# |
| 33 | +# HALO - The number of halo rows/cols. Only for regional grids. |
| 34 | +# Otherwise, comment out. |
| 35 | +# |
| 36 | +# WORK_DIR - Working directory. |
| 37 | +# |
| 38 | +# SAVE_DIR - Directory where the surface files will be saved. |
| 39 | +# |
| 40 | +# veg_type_src - Input vegetation type data. Choices are: |
| 41 | +# For viirs-based vegetation type data, set to: |
| 42 | +# - "viirs.igbp.0.1" for global 0.10-deg data |
| 43 | +# - "viirs.igbp.0.05" for global 0.05-deg data |
| 44 | +# - "viirs.igbp.0.03" for global 0.03-deg data |
| 45 | +# - "viirs.igbp.conus.30s" for CONUS 30s data |
| 46 | +# - "viirs.igbp.nh.30s" for NH 30s data |
| 47 | +# - "viirs.igbp.30s" for global 30s data |
| 48 | +# For the modis-based vegetation data, set to: |
| 49 | +# - "modis.igbp.0.05" for global 0.05-deg data |
| 50 | +# - "modis.igbp.0.03" for global 0.03-deg data |
| 51 | +# - "modis.igbp.conus.30s" for CONUS 30s data |
| 52 | +# - "modis.igbp.nh.30s" for NH 30s data |
| 53 | +# - "modis.igbp.30s" for global 30s data |
| 54 | +# |
| 55 | +# soil_type_src - Input soil type data. Choices are: |
| 56 | +# For STATSGO soil type data |
| 57 | +# - "statsgo.0.05" for global 0.05-deg data |
| 58 | +# - "statsgo.0.03" for global 0.03-deg data |
| 59 | +# - "statsgo.conus.30s" for CONUS 30s data |
| 60 | +# - "statsgo.nh.30s" for NH 30s data |
| 61 | +# - "statsgo.30s" for global 30s data |
| 62 | +# For Beijing Norm. Univ. soil type data |
| 63 | +# - "bnu.30s" for global 30s data |
| 64 | +# |
| 65 | +# vegsoilt_frac - When .true., output the fraction of each |
| 66 | +# vegetation and soil type and the dominant |
| 67 | +# category. When .false., output dominant |
| 68 | +# category only. |
| 69 | +#----------------------------------------------------------------------- |
| 70 | + |
| 71 | +set -x |
| 72 | + |
| 73 | +#export res=96 |
| 74 | +export res=96.mx100 |
| 75 | + |
| 76 | +#HALO=4 |
| 77 | +#export GRIDTYPE=regional |
| 78 | +#FIX_REG=/lfs/h2/emc/stmp/$LOGNAME/fix.reg |
| 79 | + |
| 80 | +export veg_type_src="modis.igbp.0.05" |
| 81 | + |
| 82 | +export soil_type_src="statsgo.0.05" |
| 83 | + |
| 84 | +export WORK_DIR=/lfs/h2/emc/stmp/$LOGNAME/work.sfc |
| 85 | +export SAVE_DIR=/lfs/h2/emc/stmp/$LOGNAME/sfc.C${res} |
| 86 | + |
| 87 | +export FIX_FV3=${BASE_DIR}/fix/orog/C${res} |
| 88 | + |
| 89 | +export vegsoilt_frac=.true. |
| 90 | + |
| 91 | +#------------------------------------------------------------------------ |
| 92 | +#------------------------------------------------------------------------ |
| 93 | +# Should not have to touch anything below here. |
| 94 | +#------------------------------------------------------------------------ |
| 95 | +#------------------------------------------------------------------------ |
| 96 | + |
| 97 | +if [[ "$GRIDTYPE" = "regional" ]]; then |
| 98 | + mkdir -p $FIX_REG |
| 99 | + ln -fs $FIX_FV3/C${res}_grid.tile7.halo${HALO}.nc $FIX_REG/C${res}_grid.tile7.halo${HALO}.nc |
| 100 | + ln -fs $FIX_FV3/C${res}_oro_data.tile7.halo${HALO}.nc $FIX_REG/C${res}_oro_data.tile7.nc |
| 101 | + ln -fs $FIX_FV3/C${res}_mosaic.nc $FIX_REG/C${res}_mosaic.nc |
| 102 | + export mosaic_file=$FIX_REG/C${res}_mosaic.nc |
| 103 | + export FIX_FV3=$FIX_REG |
| 104 | + HALO=$(( $HALO + 1 )) |
| 105 | + export HALO |
| 106 | +else |
| 107 | + res2=${res//".mx"*} |
| 108 | + export mosaic_file=$FIX_FV3/C${res2}_mosaic.nc |
| 109 | +fi |
| 110 | + |
| 111 | +export input_sfc_climo_dir=${BASE_DIR}/fix/sfc_climo |
| 112 | + |
| 113 | +ulimit -a |
| 114 | +ulimit -s unlimited |
| 115 | + |
| 116 | +source ${BASE_DIR}/sorc/machine-setup.sh > /dev/null 2>&1 |
| 117 | +module use ${BASE_DIR}/modulefiles |
| 118 | +module load build.$target.intel |
| 119 | +module list |
| 120 | + |
| 121 | +rm -fr $WORK_DIR $SAVE_DIR |
| 122 | + |
| 123 | +export APRUN |
| 124 | + |
| 125 | +${BASE_DIR}/ush/sfc_climo_gen.sh |
| 126 | + |
| 127 | +exit |
0 commit comments