Skip to content

Commit

Permalink
Merge pull request #20 from noaa-oar-arl/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
drnimbusrain authored Aug 4, 2021
2 parents ada1efa + 2114a8e commit fc3814e
Show file tree
Hide file tree
Showing 33 changed files with 2,114 additions and 14 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ The variables listed here are set by the user in the NACC run script, and they a
Logical to choose if the NOAA-ARL time-dependend bioseasons withc is used in CMAQ: based on summer/winter seasonal information and T2, and is output in METCRO2D file.
- `False`: Do not calculate and output SEASON variable in METCRO2D
- `True`: Calculate and output SEASON variable in METCRO2D
- `IFCANOPY [default: False]`
Logical to choose if the ECCC in-canopy shading effects are used in CMAQ: based on input canopy parameters in "GeoFile" and output in METCRO2D file.
- `False`: Do not input/output ECCC canopy parameters
- `True`: Input/output of ECCC canopy parameters
- `MCIP_START [format: YYYY-MM-DD-HH:MM:SS.SSSS]`
Beginning date and time (UTC) of data to output from NACC. The start date and time must be contained within the input data from WRF or FV3-GFS.
- `MCIP_END [format: YYYY-MM-DD-HH:MM:SS.SSSS]`
Expand Down
17 changes: 9 additions & 8 deletions parallel/scripts/run-nacc-fv3.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ NTIMES=73
export NODES=12

APPL=aqm.t12z
InMetDir=/gpfs/hps2/ptmp/Patrick.C.Campbell/NACC_FV3GFS16_runs/sens8_nacc_cmaq531_nofire_viirs_lai/com/aqm/prod/aqm.20201017
InGeoDir=/gpfs/hps3/emc/naqfc/noscrub/Youhua.Tang/nwdev/NAQFC-WCOSS/fix
InMetDir=/gpfs/hps2/ptmp/Patrick.C.Campbell/fv3gfs16_testdata
InGeoDir=/gpfs/hps3/emc/naqfc/noscrub/Patrick.C.Campbell/nacc_geofiles
InVIIRSDir_GVF=/gpfs/hps3/emc/naqfc/noscrub/Patrick.C.Campbell/viirs_gvf_test/grib2
InVIIRSDir_LAI=/gpfs/hps3/emc/naqfc/noscrub/Patrick.C.Campbell/viirs_lai_test/
OutDir=/gpfs/hps2/ptmp/$USER/NACC_test_bioseason/
ProgDir=/gpfs/hps3/emc/naqfc/noscrub/Patrick.C.Campbell/NACC_bioseason/parallel/src
OutDir=/gpfs/hps2/ptmp/Patrick.C.Campbell/fv3gfs16_testdata/nacc_output_parallel_canopy_shade
ProgDir=/gpfs/hps3/emc/naqfc/noscrub/Patrick.C.Campbell/NACC_canopy_shade/parallel/src

if [ ! -s $InMetDir ]; then
echo "No such input directory $InMetDir"
Expand Down Expand Up @@ -59,7 +59,7 @@ cat>namelist.mcip<<!
file_gd = 'GRIDDESC'
file_mm = '$InMetDir/gfs.t12z.atmf','.nc'
file_sfc = '$InMetDir/gfs.t12z.sfcf','.nc'
file_geo = '$InGeoDir/gfs.t12z.geo.08.nc'
file_geo = '$InGeoDir/gfs.t12z.geo.01.canopy.nc'
file_viirs_gvf = '$InVIIRSDir_GVF/GVF-WKL-GLB_v2r3_j01_s20200824_e20200830_c202008311235100.grib2.nc'
file_viirs_lai = '$InVIIRSDir_LAI/VIIRS_VNP15A2H.001_20190829.nc'
ioform = 1
Expand All @@ -78,9 +78,10 @@ cat>namelist.mcip<<!
ifviirs_gvf = .FALSE.
ifviirs_lai = .FALSE.
iffengsha_dust = .FALSE.
ifbioseason = .TRUE.
mcip_start = "2020-10-17-12:00:00.0000"
mcip_end = "2020-10-20-13:00:00.0000"
ifbioseason = .FALSE.
ifcanopy = .TRUE.
mcip_start = "2020-01-12-12:00:00.0000"
mcip_end = "2020-01-15-13:00:00.0000"
intvl = 60
coordnam = "FV3_RPO"
grdnam = "FV3_CONUS"
Expand Down
6 changes: 6 additions & 0 deletions parallel/scripts/run-nacc-fv3_slurm.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ cat>namelist.mcip<<!
lpv = 0
lwout = 1
luvbout = 1
ifdiag_pbl = .FALSE.
ifviirs_gvf = .FALSE.
ifviirs_lai = .FALSE.
iffengsha_dust = .FALSE.
ifbioseason = .TRUE.
ifcanopy = .FALSE.
mcip_start = "2019-07-12-12:00:00.0000"
mcip_end = "2019-07-15-13:00:00.0000"
intvl = 60
Expand Down
23 changes: 22 additions & 1 deletion parallel/src/alloc_ctm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ SUBROUTINE alloc_ctm
INTEGER :: npxwrf41
INTEGER :: nfengsha
INTEGER :: nbioseason
INTEGER :: ncanopy
INTEGER :: ntke
INTEGER :: npv
INTEGER :: nwout
Expand Down Expand Up @@ -216,13 +217,20 @@ SUBROUTINE alloc_ctm
nfengsha = 0
ENDIF

IF ( ifcanopy ) THEN
ncanopy = 9 ! FCH, FRT, CLU, POPU, LAIE, C1R, C2R, C3R, C4R
ELSE
ncanopy = 0
ENDIF

IF ( ifbioseason ) THEN
nbioseason = 1 ! SEASON
ELSE
nbioseason = 0
ENDIF

nfld2dxyt = 29 + nwr + nsoil2d + npxwrf41 + nfengsha + nbioseason

nfld2dxyt = 29 + nwr + nsoil2d + npxwrf41 + nfengsha + nbioseason + ncanopy

ALLOCATE ( fld2dxyt ( nfld2dxyt ) )

Expand Down Expand Up @@ -293,6 +301,19 @@ SUBROUTINE alloc_ctm
c_season => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+1)
ENDIF

IF ( ( ifcanopy ) ) THEN
c_fch => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+1)
c_frt => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+2)
c_clu => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+3)
c_popu => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+4)
c_laie => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+5)
c_c1r => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+6)
c_c2r => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+7)
c_c3r => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+8)
c_c4r => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+nbioseason+9)
ENDIF


!-------------------------------------------------------------------------------
! Time-varying 3d fields at cell centers.
!-------------------------------------------------------------------------------
Expand Down
39 changes: 39 additions & 0 deletions parallel/src/alloc_met.f90
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,45 @@ SUBROUTINE alloc_met
ENDIF
ENDIF

IF ( ( ifcanopy ) ) THEN
IF ( iffch ) THEN ! forest canopy height available
ALLOCATE ( fch (met_nx, met_ny) )
ENDIF

IF ( iffrt ) THEN ! forest fraction field available
ALLOCATE ( frt (met_nx, met_ny) )
ENDIF

IF ( ifclu ) THEN ! forest clumping indext available
ALLOCATE ( clu (met_nx, met_ny) )
ENDIF

IF ( ifpopu ) THEN ! population density available
ALLOCATE ( popu (met_nx, met_ny) )
ENDIF

IF ( iflaie ) THEN ! ECCC lai (MODIS) available
ALLOCATE ( laie (met_nx, met_ny) )
ENDIF

IF ( ifc1r ) THEN ! cumulative LAI fraction hc to 0.75 * hc
ALLOCATE ( c1r (met_nx, met_ny) )
ENDIF

IF ( ifc2r ) THEN ! cumulative LAI fraction hc to 0.50 * hc
ALLOCATE ( c2r (met_nx, met_ny) )
ENDIF

IF ( ifc3r ) THEN ! cumulative LAI fraction hc to 0.35 * hc
ALLOCATE ( c3r (met_nx, met_ny) )
ENDIF

IF ( ifc4r ) THEN ! cumulative LAI fraction hc to 0.20 * hc
ALLOCATE ( c4r (met_nx, met_ny) )
ENDIF

ENDIF

IF ( ifmol ) THEN ! Monin-Obukhov length available
ALLOCATE ( mol (ix, jy) )
ENDIF
Expand Down
13 changes: 13 additions & 0 deletions parallel/src/alloc_x.f90
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ SUBROUTINE alloc_x
ALLOCATE ( xseason (ncols_x, nrows_x) )
ENDIF

IF ( ( ifcanopy ) ) THEN
ALLOCATE ( xfch (ncols_x, nrows_x) )
ALLOCATE ( xfrt (ncols_x, nrows_x) )
ALLOCATE ( xclu (ncols_x, nrows_x) )
ALLOCATE ( xpopu (ncols_x, nrows_x) )
ALLOCATE ( xlaie (ncols_x, nrows_x) )
ALLOCATE ( xc1r (ncols_x, nrows_x) )
ALLOCATE ( xc2r (ncols_x, nrows_x) )
ALLOCATE ( xc3r (ncols_x, nrows_x) )
ALLOCATE ( xc4r (ncols_x, nrows_x) )
ENDIF


ALLOCATE ( xveg (ncols_x, nrows_x) )

ALLOCATE ( xwstar (ncols_x, nrows_x) )
Expand Down
13 changes: 13 additions & 0 deletions parallel/src/ctmproc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@ END SUBROUTINE collapx
IF ( ( ifbioseason ) ) THEN
c_season%fld(col,row) = xseason(c,r)
ENDIF

IF ( ( ifcanopy ) ) THEN
c_fch%fld(col,row) = xfch(c,r)
c_frt%fld(col,row) = xfrt(c,r)
c_clu%fld(col,row) = xclu(c,r)
c_popu%fld(col,row) = xpopu(c,r)
c_laie%fld(col,row) = xlaie(c,r)
c_c1r%fld(col,row) = xc1r(c,r)
c_c2r%fld(col,row) = xc2r(c,r)
c_c3r%fld(col,row) = xc3r(c,r)
c_c4r%fld(col,row) = xc4r(c,r)
ENDIF

c_seaice%fld(col,row) = xseaice(c,r)
c_snowh%fld(col,row) = xsnowh(c,r)

Expand Down
9 changes: 9 additions & 0 deletions parallel/src/ctmvars_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ MODULE ctmvars
TYPE(fld2ddata), POINTER :: c_ssm
TYPE(fld2ddata), POINTER :: c_uthr
TYPE(fld2ddata), POINTER :: c_season
TYPE(fld2ddata), POINTER :: c_fch
TYPE(fld2ddata), POINTER :: c_frt
TYPE(fld2ddata), POINTER :: c_clu
TYPE(fld2ddata), POINTER :: c_popu
TYPE(fld2ddata), POINTER :: c_laie
TYPE(fld2ddata), POINTER :: c_c1r
TYPE(fld2ddata), POINTER :: c_c2r
TYPE(fld2ddata), POINTER :: c_c3r
TYPE(fld2ddata), POINTER :: c_c4r
TYPE(fld2ddata), POINTER :: c_seaice
TYPE(fld2ddata), POINTER :: c_snowh
TYPE(fld2ddata), POINTER :: c_wr
Expand Down
102 changes: 102 additions & 0 deletions parallel/src/init_ctm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,108 @@ SUBROUTINE init_ctm
c_season%iend(2) = ny
ENDIF

IF ( ( ifcanopy ) ) THEN
c_fch%fld = fillreal
c_fch%fldname = 'FCH'
c_fch%long_name = 'forest canopy height'
c_fch%units = 'm'
c_fch%dimnames(1) = 'nx'
c_fch%dimnames(2) = 'ny'
c_fch%istart(1) = 1
c_fch%istart(2) = 1
c_fch%iend(1) = nx
c_fch%iend(2) = ny

c_frt%fld = fillreal
c_frt%fldname = 'FRT'
c_frt%long_name = 'forest fraction'
c_frt%units = '1'
c_frt%dimnames(1) = 'nx'
c_frt%dimnames(2) = 'ny'
c_frt%istart(1) = 1
c_frt%istart(2) = 1
c_frt%iend(1) = nx
c_frt%iend(2) = ny

c_clu%fld = fillreal
c_clu%fldname = 'CLU'
c_clu%long_name = 'clumping index'
c_clu%units = '1'
c_clu%dimnames(1) = 'nx'
c_clu%dimnames(2) = 'ny'
c_clu%istart(1) = 1
c_clu%istart(2) = 1
c_clu%iend(1) = nx
c_clu%iend(2) = ny

c_popu%fld = fillreal
c_popu%fldname = 'POPU'
c_popu%long_name = 'population density'
c_popu%units = 'people/10km2'
c_popu%dimnames(1) = 'nx'
c_popu%dimnames(2) = 'ny'
c_popu%istart(1) = 1
c_popu%istart(2) = 1
c_popu%iend(1) = nx
c_popu%iend(2) = ny

c_laie%fld = fillreal
c_laie%fldname = 'LAIE'
c_laie%long_name = 'Leaf Area Index (ECCC)'
c_laie%units = 'm2 m-2'
c_laie%dimnames(1) = 'nx'
c_laie%dimnames(2) = 'ny'
c_laie%istart(1) = 1
c_laie%istart(2) = 1
c_laie%iend(1) = nx
c_laie%iend(2) = ny

c_c1r%fld = fillreal
c_c1r%fldname = 'C1R'
c_c1r%long_name = 'cumulative LAI fraction hc to 0.75 * hc'
c_c1r%units = '1'
c_c1r%dimnames(1) = 'nx'
c_c1r%dimnames(2) = 'ny'
c_c1r%istart(1) = 1
c_c1r%istart(2) = 1
c_c1r%iend(1) = nx
c_c1r%iend(2) = ny

c_c2r%fld = fillreal
c_c2r%fldname = 'C2R'
c_c2r%long_name = 'cumulative LAI fraction hc to 0.50 * hc'
c_c2r%units = '1'
c_c2r%dimnames(1) = 'nx'
c_c2r%dimnames(2) = 'ny'
c_c2r%istart(1) = 1
c_c2r%istart(2) = 1
c_c2r%iend(1) = nx
c_c2r%iend(2) = ny

c_c3r%fld = fillreal
c_c3r%fldname = 'C3R'
c_c3r%long_name = 'cumulative LAI fraction hc to 0.35 * hc'
c_c3r%units = '1'
c_c3r%dimnames(1) = 'nx'
c_c3r%dimnames(2) = 'ny'
c_c3r%istart(1) = 1
c_c3r%istart(2) = 1
c_c3r%iend(1) = nx
c_c3r%iend(2) = ny

c_c4r%fld = fillreal
c_c4r%fldname = 'C4R'
c_c4r%long_name = 'cumulative LAI fraction hc to 0.20 * hc'
c_c4r%units = '1'
c_c4r%dimnames(1) = 'nx'
c_c4r%dimnames(2) = 'ny'
c_c4r%istart(1) = 1
c_c4r%istart(2) = 1
c_c4r%iend(1) = nx
c_c4r%iend(2) = ny

ENDIF

c_seaice%fld = fillreal
c_seaice%fldname = 'SEAICE'
c_seaice%long_name = 'sea ice'
Expand Down
8 changes: 8 additions & 0 deletions parallel/src/init_x.f90
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ SUBROUTINE init_x
xseason (:,:) = fillreal
ENDIF

IF ( ( ifcanopy ) ) THEN
xfch (:,:) = fillreal ; xclu (:,:) = fillreal
xfrt (:,:) = fillreal ; xpopu (:,:) = fillreal
xlaie (:,:) = fillreal ; xc1r (:,:) = fillreal
xc2r (:,:) = fillreal ; xc3r (:,:) = fillreal
xc4r (:,:) = fillreal
ENDIF

IF ( met_hybrid >= 0 ) THEN
xmuhyb(:,:) = fillreal
ENDIF
Expand Down
21 changes: 20 additions & 1 deletion parallel/src/mcipparm_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,25 @@ MODULE mcipparm
LOGICAL :: ifssm ! sediment supply map in input file?
LOGICAL :: ifssmwrfout ! sediment supply map in WRF history?
LOGICAL :: ifuthr ! threshold velocity in input file?
LOGICAL :: ifuthrwrfout ! threshold velocity in WRF history?
LOGICAL :: ifuthrwrfout ! threshold velocity in WRF history
LOGICAL :: iffch ! forest canopy height in input file?
LOGICAL :: iffchwrfout ! forest canopy height in WRF history?
LOGICAL :: iffrt ! forest fraction in input file?
LOGICAL :: iffrtwrfout ! forest fraction in WRF history?
LOGICAL :: ifclu ! forest clumping index in input file?
LOGICAL :: ifcluwrfout ! forest clumping index in WRF history?
LOGICAL :: ifpopu ! population density in input file?
LOGICAL :: ifpopuwrfout ! population density in WRF history?
LOGICAL :: iflaie ! leaf area index (ECCC) in input file?
LOGICAL :: iflaiewrfout ! leaf area index (ECCC) in WRF history?
LOGICAL :: ifc1r ! cumulative LAI fraction hc to 0.75 * hc in input file?
LOGICAL :: ifc1rwrfout ! cumulative LAI fraction hc to 0.75 * hc in WRF history?
LOGICAL :: ifc2r ! cumulative LAI fraction hc to 0.50 * hc in input file?
LOGICAL :: ifc2rwrfout ! cumulative LAI fraction hc to 0.50 * hc in WRF history?
LOGICAL :: ifc3r ! cumulative LAI fraction hc to 0.35 * hc in input file?
LOGICAL :: ifc3rwrfout ! cumulative LAI fraction hc to 0.35 * hc in WRF history?
LOGICAL :: ifc4r ! cumulative LAI fraction hc to 0.20 * hc in input file?
LOGICAL :: ifc4rwrfout ! cumulative LAI fraction hc to 0.20 * hc in WRF history?
LOGICAL :: iflufrc ! fractional land use available?
LOGICAL :: ifluwrfout ! is fractional land use in WRF history?
LOGICAL :: iflu2wrfout ! is fractional land use 2 in WRF history?
Expand All @@ -275,6 +293,7 @@ MODULE mcipparm
LOGICAL :: ifviirs_lai ! use NAQFC VIIRS LAI?
LOGICAL :: iffengsha_dust ! use NAQFC Fengsha Windblown Dust?
LOGICAL :: ifbioseason ! use bioseason switch?
LOGICAL :: ifcanopy ! use canopy parameters?

!-------------------------------------------------------------------------------
! Run Options.
Expand Down
Loading

0 comments on commit fc3814e

Please sign in to comment.