Skip to content

Commit

Permalink
Merge pull request #11 from noaa-oar-arl/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
drnimbusrain committed Dec 7, 2020
2 parents b6fa8f7 + 3797205 commit ad77639
Show file tree
Hide file tree
Showing 30 changed files with 168 additions and 28 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,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 Fengsha Windblown dust is used in CMAQ: based on input soil parameters in "GeoFile" and output in METCRO2D file.
- `False`: Do not input/output Fengsha WB Dust soil parameters
- `True`: Input/output of Fengsha WB Dust soil parameters
- `IFBIOSEASON [default: False]`
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
- `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
@@ -1,5 +1,5 @@
#!/bin/ksh -l
#BSUB -J viirs-gvf-test
#BSUB -J nacc-test
#BSUB -o jnacc_par.out1
#BSUB -e jnacc_par.err1
#BSUB -q debug
Expand All @@ -22,12 +22,12 @@ NTIMES=73
export NODES=12

APPL=aqm.t12z
InMetDir=/gpfs/hps2/ptmp/Patrick.C.Campbell/NACC_FV3GFS16_runs/sens5_nacc_cmaq531_nofire_fengsha/com/aqm/prod/aqm.20190826
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
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_lai/
ProgDir=/gpfs/hps3/emc/naqfc/noscrub/Patrick.C.Campbell/NACC_viirs_lai/parallel/src
OutDir=/gpfs/hps2/ptmp/$USER/NACC_test_bioseason/
ProgDir=/gpfs/hps3/emc/naqfc/noscrub/Patrick.C.Campbell/NACC_bioseason/parallel/src

if [ ! -s $InMetDir ]; then
echo "No such input directory $InMetDir"
Expand Down Expand Up @@ -75,11 +75,12 @@ cat>namelist.mcip<<!
lwout = 1
luvbout = 1
ifdiag_pbl = .FALSE.
ifviirs_gvf = .TRUE.
ifviirs_lai = .TRUE.
ifviirs_gvf = .FALSE.
ifviirs_lai = .FALSE.
iffengsha_dust = .FALSE.
mcip_start = "2019-08-26-12:00:00.0000"
mcip_end = "2019-08-29-13:00:00.0000"
ifbioseason = .TRUE.
mcip_start = "2020-10-17-12:00:00.0000"
mcip_end = "2020-10-20-13:00:00.0000"
intvl = 60
coordnam = "FV3_RPO"
grdnam = "FV3_CONUS"
Expand Down
12 changes: 11 additions & 1 deletion parallel/src/alloc_ctm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ SUBROUTINE alloc_ctm
INTEGER :: nsoil2d
INTEGER :: npxwrf41
INTEGER :: nfengsha
INTEGER :: nbioseason
INTEGER :: ntke
INTEGER :: npv
INTEGER :: nwout
Expand Down Expand Up @@ -215,8 +216,13 @@ SUBROUTINE alloc_ctm
nfengsha = 0
ENDIF

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

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

ALLOCATE ( fld2dxyt ( nfld2dxyt ) )

Expand Down Expand Up @@ -283,6 +289,10 @@ SUBROUTINE alloc_ctm
c_uthr => fld2dxyt(29+nwr+nsoil2d+npxwrf41+5)
ENDIF

IF ( ( ifbioseason ) ) THEN
c_season => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+1)
ENDIF

!-------------------------------------------------------------------------------
! Time-varying 3d fields at cell centers.
!-------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions parallel/src/alloc_x.f90
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,19 @@ SUBROUTINE alloc_x
ALLOCATE ( xrgrnd (ncols_x, nrows_x) )
ALLOCATE ( xwr (ncols_x, nrows_x) )
ALLOCATE ( xlai (ncols_x, nrows_x) )

IF ( ( iffengsha_dust ) ) THEN
ALLOCATE ( xclayf (ncols_x, nrows_x) )
ALLOCATE ( xsandf (ncols_x, nrows_x) )
ALLOCATE ( xdrag (ncols_x, nrows_x) )
ALLOCATE ( xssm (ncols_x, nrows_x) )
ALLOCATE ( xuthr (ncols_x, nrows_x) )
ENDIF

IF ( ( ifbioseason ) ) THEN
ALLOCATE ( xseason (ncols_x, nrows_x) )
ENDIF

ALLOCATE ( xveg (ncols_x, nrows_x) )

ALLOCATE ( xwstar (ncols_x, nrows_x) )
Expand Down
3 changes: 3 additions & 0 deletions parallel/src/ctmproc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ END SUBROUTINE collapx
c_ssm%fld(col,row) = xssm(c,r)
c_uthr%fld(col,row) = xuthr(c,r)
ENDIF
IF ( ( ifbioseason ) ) THEN
c_season%fld(col,row) = xseason(c,r)
ENDIF
c_seaice%fld(col,row) = xseaice(c,r)
c_snowh%fld(col,row) = xsnowh(c,r)

Expand Down
1 change: 1 addition & 0 deletions parallel/src/ctmvars_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ MODULE ctmvars
TYPE(fld2ddata), POINTER :: c_drag
TYPE(fld2ddata), POINTER :: c_ssm
TYPE(fld2ddata), POINTER :: c_uthr
TYPE(fld2ddata), POINTER :: c_season
TYPE(fld2ddata), POINTER :: c_seaice
TYPE(fld2ddata), POINTER :: c_snowh
TYPE(fld2ddata), POINTER :: c_wr
Expand Down
11 changes: 6 additions & 5 deletions parallel/src/dealloc_ctm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ SUBROUTINE dealloc_ctm
NULLIFY ( c_lai )
NULLIFY ( c_seaice )
NULLIFY ( c_snowh )
NULLIFY ( c_clayf )
NULLIFY ( c_sandf )
NULLIFY ( c_drag )
NULLIFY ( c_ssm )
NULLIFY ( c_uthr )
IF ( ASSOCIATED ( c_clayf ) ) NULLIFY ( c_clayf )
IF ( ASSOCIATED ( c_sandf ) ) NULLIFY ( c_sandf )
IF ( ASSOCIATED ( c_drag ) ) NULLIFY ( c_drag )
IF ( ASSOCIATED ( c_ssm ) ) NULLIFY ( c_ssm )
IF ( ASSOCIATED ( c_uthr ) ) NULLIFY ( c_uthr )
IF ( ASSOCIATED ( c_season ) ) NULLIFY ( c_season )

IF ( ASSOCIATED ( c_wr ) ) NULLIFY ( c_wr )
IF ( ASSOCIATED ( c_soim1 ) ) NULLIFY ( c_soim1 )
Expand Down
3 changes: 3 additions & 0 deletions parallel/src/dealloc_x.f90
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ SUBROUTINE dealloc_x
IF ( ALLOCATED ( xdrag ) ) DEALLOCATE ( xdrag )
IF ( ALLOCATED ( xssm ) ) DEALLOCATE ( xssm )
IF ( ALLOCATED ( xuthr ) ) DEALLOCATE ( xuthr )

IF ( ALLOCATED ( xseason ) ) DEALLOCATE ( xseason )

DEALLOCATE ( xveg )

DEALLOCATE ( xwstar )
Expand Down
13 changes: 13 additions & 0 deletions parallel/src/init_ctm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,19 @@ SUBROUTINE init_ctm
c_uthr%iend(2) = ny
ENDIF

IF ( ifbioseason ) THEN
c_season%fld = fillreal
c_season%fldname = 'SEASON'
c_season%long_name = 'bioseason flag'
c_season%units = '1'
c_season%dimnames(1) = 'nx'
c_season%dimnames(2) = 'ny'
c_season%istart(1) = 1
c_season%istart(2) = 1
c_season%iend(1) = nx
c_season%iend(2) = ny
ENDIF

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

IF ( ( ifbioseason ) ) THEN
xseason (:,:) = fillreal
ENDIF

IF ( met_hybrid >= 0 ) THEN
xmuhyb(:,:) = fillreal
ENDIF
Expand Down
1 change: 1 addition & 0 deletions parallel/src/mcipparm_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ MODULE mcipparm
LOGICAL :: ifviirs_gvf ! use NAQFC VIIRS GVF?
LOGICAL :: ifviirs_lai ! use NAQFC VIIRS LAI?
LOGICAL :: iffengsha_dust ! use NAQFC Fengsha Windblown Dust?
LOGICAL :: ifbioseason ! use bioseason switch?

!-------------------------------------------------------------------------------
! Run Options.
Expand Down
23 changes: 22 additions & 1 deletion parallel/src/pblsup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ SUBROUTINE pblsup
! 26 Jun 2018 Now use netCDF tokens for missing data. (T. Spero)
! 14 Sep 2018 Removed support for MM5v3 input. (T. Spero)
!-------------------------------------------------------------------------------

USE metinfo
USE mcipparm
USE xvars
USE const
Expand Down Expand Up @@ -309,6 +309,27 @@ END SUBROUTINE getpblht
xwstar(c,r) = 0.0
ENDIF

! User-defined calculation of the BEIS bioseason/freeze flag based on 2-m temperature
! Needs updating with more robust T2/Q2 parameterization
IF ( ifbioseason ) THEN
IF ( met_season == 1 ) THEN ! N. Hemisphere "summer" months
IF ( xtemp2(c,r) < 269.15 ) THEN !check if temperature < -4C, 28F.
xseason(c,r)=0. ! winter
ELSE
xseason(c,r)=1. ! summer
END IF
END IF

IF ( met_season == 2 ) THEN ! N. Hemisphere "winter" months
IF ( xtemp2(c,r) > 273.15 ) THEN !check if temperature > 0C, 32F.
xseason(c,r)=1. ! summer
ELSE
xseason(c,r)=0. ! winter
END IF
END IF

ENDIF

ENDDO
ENDDO

Expand Down
4 changes: 2 additions & 2 deletions parallel/src/rdfv3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2368,7 +2368,6 @@ END SUBROUTINE windrotation
!-------------------------------------------------------------------------------
! If this is the first time in this routine, then determine season.
!-------------------------------------------------------------------------------
! But if global
IF ( first ) THEN

! These seasons are used in MM5 and WRF for land-use lookup tables.
Expand All @@ -2392,10 +2391,11 @@ END SUBROUTINE windrotation
met_season = 2 ! winter
ENDIF
ENDIF

!-------------------------------------------------------------------------------
! If roughness length was not available in output, fill it from lookup tables.
! If the urban model was used in WRF, replace roughness length with urban-
! specific arrays.
! specific arrays.
!-------------------------------------------------------------------------------

IF ( .NOT. gotznt ) THEN
Expand Down
3 changes: 2 additions & 1 deletion parallel/src/readnml.f90
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ SUBROUTINE readnml (ctmlays)

NAMELIST /userdefs/ inmetmodel, dx_in, dy_in, met_cen_lat_in, met_cen_lon_in, &
lpv, lwout, luvbout, ifdiag_pbl, ifviirs_gvf, &
ifviirs_lai, iffengsha_dust, &
ifviirs_lai, iffengsha_dust, ifbioseason, &
eradm, mcip_start, mcip_end, ntimes, intvl, &
coordnam, grdnam, ctmlays, &
btrim, lprt_col, lprt_row, &
Expand Down Expand Up @@ -257,6 +257,7 @@ SUBROUTINE readnml (ctmlays)
ifviirs_gvf = .false. ! To use NAQFC VIIRS GVF input
ifviirs_lai = .false. ! To use NAQFC VIIRS LAI input
iffengsha_dust = .false. ! To use NAQFC Fengsha Windblown Dust
ifbioseason = .false. ! To use bioseason switch
!-------------------------------------------------------------------------------
! Set default value for earth radius in meters (ERADM). The default value is
! consistent with the value used for a spherical earth in MM5 and in WRF-ARW.
Expand Down
2 changes: 2 additions & 0 deletions parallel/src/xvars_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ MODULE xvars
REAL, ALLOCATABLE :: xveg ( : , : ) ! vegetation coverage [decimal]
REAL, ALLOCATABLE :: xsltyp ( : , : ) ! soil texture type [category]

REAL, ALLOCATABLE :: xseason ( : , : ) ! bioseason flag [1=summer, 0=winter]

REAL, ALLOCATABLE :: xwsat_px ( : , : ) ! soil saturation (PX) [m3/m3]
REAL, ALLOCATABLE :: xwwlt_px ( : , : ) ! soil wilt pt (PX) [m3/m3]
REAL, ALLOCATABLE :: xwfc_px ( : , : ) ! soil fld capacity (PX) [m3/m3]
Expand Down
5 changes: 4 additions & 1 deletion serial/scripts/run-nacc-fv3.csh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ cat>namelist.mcip<<!
file_mm = '$InMetDir/gfs.t12z.atmf','.nc'
file_sfc = '$InMetDir/gfs.t12z.sfcf','.nc'
file_geo = '$InGeoDir/gfs.t12z.geo.07.nc'
file_viirs_gvf = '$InVIIRSDir/GVF-WKL-GLB_v2r3_j01_s20200824_e20200830_c202008311235100.grib2.nc'
file_viirs_gvf = '$IVIIRSDir/GVF-WKL-GLB_v2r3_j01_s20200824_e20200830_c202008311235100.grib2.nc'
file_viirs_lai = '$InVIIRSDir/VIIRS_VNP15A2H.001_20190829.nc'
ioform = 1
&END
Expand All @@ -53,7 +54,9 @@ cat>namelist.mcip<<!
luvbout = 1
ifdiag_pbl = .FALSE.
ifviirs_gvf = .FALSE.
ifviirs_lai = .FALSE.
iffengsha_dust = .FALSE.
ifbioseason = .FALSE.
mcip_start = "2019-07-12-12:00:00.0000"
mcip_end = "2019-07-15-13:00:00.0000"
intvl = 60
Expand Down
1 change: 1 addition & 0 deletions serial/scripts/run-nacc-fv3.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ cat>namelist.mcip<<!
ifviirs_gvf = .FALSE.
ifviirs_lai = .FALSE.
iffengsha_dust = .FALSE.
ifbioseason = .FALSE.
mcip_start = "2019-08-12-12:00:00.0000"
mcip_end = "2019-08-15-13:00:00.0000"
intvl = 60
Expand Down
12 changes: 11 additions & 1 deletion serial/src/alloc_ctm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ SUBROUTINE alloc_ctm
INTEGER :: nsoil2d
INTEGER :: npxwrf41
INTEGER :: nfengsha
INTEGER :: nbioseason
INTEGER :: ntke
INTEGER :: npv
INTEGER :: nwout
Expand Down Expand Up @@ -215,8 +216,13 @@ SUBROUTINE alloc_ctm
nfengsha = 0
ENDIF

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

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

ALLOCATE ( fld2dxyt ( nfld2dxyt ) )

Expand Down Expand Up @@ -283,6 +289,10 @@ SUBROUTINE alloc_ctm
c_uthr => fld2dxyt(29+nwr+nsoil2d+npxwrf41+5)
ENDIF

IF ( ( ifbioseason ) ) THEN
c_season => fld2dxyt(29+nwr+nsoil2d+npxwrf41+nfengsha+1)
ENDIF

!-------------------------------------------------------------------------------
! Time-varying 3d fields at cell centers.
!-------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions serial/src/alloc_x.f90
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,19 @@ SUBROUTINE alloc_x
ALLOCATE ( xrgrnd (ncols_x, nrows_x) )
ALLOCATE ( xwr (ncols_x, nrows_x) )
ALLOCATE ( xlai (ncols_x, nrows_x) )

IF ( ( iffengsha_dust ) ) THEN
ALLOCATE ( xclayf (ncols_x, nrows_x) )
ALLOCATE ( xsandf (ncols_x, nrows_x) )
ALLOCATE ( xdrag (ncols_x, nrows_x) )
ALLOCATE ( xssm (ncols_x, nrows_x) )
ALLOCATE ( xuthr (ncols_x, nrows_x) )
ENDIF

IF ( ( ifbioseason ) ) THEN
ALLOCATE ( xseason (ncols_x, nrows_x) )
ENDIF

ALLOCATE ( xveg (ncols_x, nrows_x) )

ALLOCATE ( xwstar (ncols_x, nrows_x) )
Expand Down
3 changes: 3 additions & 0 deletions serial/src/ctmproc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ END SUBROUTINE collapx
c_ssm%fld(col,row) = xssm(c,r)
c_uthr%fld(col,row) = xuthr(c,r)
ENDIF
IF ( ( ifbioseason ) ) THEN
c_season%fld(col,row) = xseason(c,r)
ENDIF
c_seaice%fld(col,row) = xseaice(c,r)
c_snowh%fld(col,row) = xsnowh(c,r)

Expand Down
1 change: 1 addition & 0 deletions serial/src/ctmvars_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ MODULE ctmvars
TYPE(fld2ddata), POINTER :: c_drag
TYPE(fld2ddata), POINTER :: c_ssm
TYPE(fld2ddata), POINTER :: c_uthr
TYPE(fld2ddata), POINTER :: c_season
TYPE(fld2ddata), POINTER :: c_seaice
TYPE(fld2ddata), POINTER :: c_snowh
TYPE(fld2ddata), POINTER :: c_wr
Expand Down
11 changes: 6 additions & 5 deletions serial/src/dealloc_ctm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ SUBROUTINE dealloc_ctm
NULLIFY ( c_lai )
NULLIFY ( c_seaice )
NULLIFY ( c_snowh )
NULLIFY ( c_clayf )
NULLIFY ( c_sandf )
NULLIFY ( c_drag )
NULLIFY ( c_ssm )
NULLIFY ( c_uthr )
IF ( ASSOCIATED ( c_clayf ) ) NULLIFY ( c_clayf )
IF ( ASSOCIATED ( c_sandf ) ) NULLIFY ( c_sandf )
IF ( ASSOCIATED ( c_drag ) ) NULLIFY ( c_drag )
IF ( ASSOCIATED ( c_ssm ) ) NULLIFY ( c_ssm )
IF ( ASSOCIATED ( c_uthr ) ) NULLIFY ( c_uthr )
IF ( ASSOCIATED ( c_season ) ) NULLIFY ( c_season )

IF ( ASSOCIATED ( c_wr ) ) NULLIFY ( c_wr )
IF ( ASSOCIATED ( c_soim1 ) ) NULLIFY ( c_soim1 )
Expand Down
Loading

0 comments on commit ad77639

Please sign in to comment.