chgres_cube  1.13.0
All Data Structures Namespaces Files Functions Variables Pages
program_setup.F90
Go to the documentation of this file.
1 
4 
9  module program_setup
10 
11  use esmf
12  use utilities, only : error_handler, to_lower
13 
14  implicit none
15 
16  private
17 
18  character(len=500), public :: varmap_file = "NULL"
19  character(len=500), public :: atm_files_input_grid(6) = "NULL"
23  character(len=500), public :: atm_core_files_input_grid(7) = "NULL"
24  character(len=500), public :: atm_tracer_files_input_grid(6) = "NULL"
25  character(len=500), public :: data_dir_input_grid = "NULL"
26  character(len=500), public :: fix_dir_target_grid = "NULL"
27  character(len=500), public :: mosaic_file_input_grid = "NULL"
28  character(len=500), public :: mosaic_file_target_grid = "NULL"
29  character(len=500), public :: nst_files_input_grid = "NULL"
30  character(len=500), public :: grib2_file_input_grid = "NULL"
31  character(len=500), public :: geogrid_file_input_grid = "NULL"
34  character(len=500), public :: orog_dir_input_grid = "NULL"
35  character(len=500), public :: orog_files_input_grid(6) = "NULL"
36  character(len=500), public :: orog_dir_target_grid = "NULL"
37  character(len=500), public :: orog_files_target_grid(6) = "NULL"
38  character(len=500), public :: sfc_files_input_grid(6) = "NULL"
39  character(len=500), public :: vcoord_file_target_grid = "NULL"
40  character(len=500), public :: thomp_mp_climo_file= "NULL"
41  character(len=15), public :: cres_target_grid = "NULL"
42  character(len=500), public :: atm_weight_file="NULL"
43  character(len=25), public :: input_type="restart"
57  character(len=20), public :: external_model="GFS"
58 
59  integer, parameter, public :: max_tracers=100
60  integer, public :: num_tracers
61  integer, public :: num_tracers_input
62 
63  logical, allocatable, public :: read_from_input(:)
65 
66  character(len=20), public :: tracers(max_tracers)="NULL"
72  character(len=20), public :: tracers_input(max_tracers)="NULL"
77  character(len=20), allocatable, public :: missing_var_methods(:)
79  character(len=20), allocatable, public :: chgres_var_names(:)
81  character(len=20), allocatable, public :: field_var_names(:)
82 
83  character(len=500), public :: wam_parm_file="msis21.parm"
84 
85  integer, public :: cycle_year = -999
86  integer, public :: cycle_mon = -999
87  integer, public :: cycle_day = -999
88  integer, public :: cycle_hour = -999
89  integer, public :: regional = 0
91  integer, public :: halo_bndy = 0
92  integer, public :: halo_blend = 0
94  integer, public :: nsoill_out = 4
96 
97  logical, public :: convert_atm = .false.
98  logical, public :: convert_nst = .false.
99  logical, public :: convert_sfc = .false.
100  logical, public :: wam_cold_start = .false.
101 
102  ! Options for replacing vegetation/soil type, veg fraction, and lai with data from the grib2 file
103  ! Default is to use climatology instead
104  logical, public :: vgtyp_from_climo = .true.
108  logical, public :: sotyp_from_climo = .true.
113  logical, public :: vgfrc_from_climo = .true.
117 
118  logical, public :: minmax_vgfrc_from_climo = .true.
122  logical, public :: lai_from_climo = .true.
125  logical, public :: tg3_from_soil = .false.
128  logical, public :: use_thomp_mp_climo=.false.
129 
130  real, allocatable, public :: drysmc_input(:)
131  real, allocatable, public :: drysmc_target(:)
132  real, allocatable, public :: maxsmc_input(:)
133  real, allocatable, public :: maxsmc_target(:)
134  real, allocatable, public :: refsmc_input(:)
135  real, allocatable, public :: refsmc_target(:)
136  real, allocatable, public :: wltsmc_input(:)
137  real, allocatable, public :: wltsmc_target(:)
138  real, allocatable, public :: bb_target(:)
139  real, allocatable, public :: satpsi_target(:)
140  real(kind=esmf_kind_r4), allocatable, public :: missing_var_values(:)
142 
143  public :: read_setup_namelist
144  public :: calc_soil_params_driver
145  public :: read_varmap
146  public :: get_var_cond
147 
148  contains
149 
155  subroutine read_setup_namelist(filename)
156  implicit none
157 
158  character(len=*), intent(in), optional :: filename
159  character(len=250), allocatable :: filename_to_use
160 
161  integer :: is, ie, ierr
162 
163  namelist /config/ varmap_file, &
183  wam_cold_start, &
189  regional, input_type, &
190  external_model, &
191  wam_parm_file, &
193  tracers_input, &
194  halo_bndy, &
195  halo_blend, &
196  nsoill_out, &
198 
199  print*,"- READ SETUP NAMELIST"
200 
201  if (present(filename)) then
202  filename_to_use = filename
203  else
204  filename_to_use = "./fort.41"
205  endif
206 
207  open(41, file=trim(filename_to_use), iostat=ierr)
208  if (ierr /= 0) call error_handler("OPENING SETUP NAMELIST.", ierr)
209  read(41, nml=config, iostat=ierr)
210  if (ierr /= 0) call error_handler("READING SETUP NAMELIST.", ierr)
211  close (41)
212 
213  call to_lower(input_type)
214 
217 
218 !-------------------------------------------------------------------------
219 ! Determine CRES of target grid from the name of the orography file.
220 !-------------------------------------------------------------------------
221 
222  is = 1
223  ie = index(orog_files_target_grid(1), "_oro_") - 1
224 
225  if (ie == 0) then
226  call error_handler("CANT DETERMINE CRES FROM OROG FILE.", 1)
227  endif
228 
230 
231  if (.not. convert_sfc .and. .not. convert_atm) then
232  call error_handler("MUST CONVERT EITHER AN ATM OR SFC FILE.", 1)
233  endif
234 
235 !-------------------------------------------------------------------------
236 ! Flag for processing stand-alone regional grid. When '1',
237 ! remove halo from atmospheric and surface data and output
238 ! atmospheric lateral boundary condition file. When '2',
239 ! create lateral boundary file only. When '0' (the default),
240 ! process normally as a global grid.
241 !-------------------------------------------------------------------------
242 
243  if (regional > 0) then
244  print*,"- PROCESSING A REGIONAL NEST WITH A BOUNDARY HALO OF ",halo_bndy
245  print*,"- PROCESSING A REGIONAL NEST WITH A BLENDING HALO OF ",halo_blend
246  else
247  halo_bndy = 0
248  halo_blend = 0
249  endif
250 
251  num_tracers = 0
252  do is = 1, max_tracers
253  if (trim(tracers(is)) == "NULL") exit
255  print*,"- TRACER NAME IN OUTPUT FILE ", trim(tracers(is))
256  enddo
257 
259  do is = 1, max_tracers
260  if (trim(tracers_input(is)) == "NULL") exit
262  print*,"- TRACER NAME IN INPUT FILE ", trim(tracers_input(is))
263  enddo
264 
265 !-------------------------------------------------------------------------
266 ! Ensure spo, spo2, and spo3 in tracers list if wam ic is on
267 !-------------------------------------------------------------------------
268 
269  if( wam_cold_start ) then
270  ierr=3
271  do is = 1, num_tracers
272  if(trim(tracers(is)) == "spo" ) ierr = ierr - 1
273  if(trim(tracers(is)) == "spo2" ) ierr = ierr - 1
274  if(trim(tracers(is)) == "spo3" ) ierr = ierr - 1
275  enddo
276  if (ierr /= 0) then
277  print*,"-ERROR: spo, spo2, and spo3 should be in tracers namelist"
278  call error_handler("WAM TRACER NAMELIST.", ierr)
279  endif
280  print*,"- WAM COLDSTART OPTION IS TURNED ON."
281  endif
282 
283 !-------------------------------------------------------------------------
284 ! Ensure program recognizes the input data type.
285 !-------------------------------------------------------------------------
286 
287  select case (trim(input_type))
288  case ("restart")
289  print*,'- INPUT DATA FROM FV3 TILED RESTART FILES.'
290  case ("history")
291  print*,'- INPUT DATA FROM FV3 TILED HISTORY FILES.'
292 #ifdef CHGRES_ALL
293  case ("gaussian_nemsio")
294  print*,'- INPUT DATA FROM FV3 GAUSSIAN NEMSIO FILE.'
295  case ("gfs_gaussian_nemsio")
296  print*,'- INPUT DATA FROM SPECTRAL GFS GAUSSIAN NEMSIO FILE.'
297  case ("gfs_sigio")
298  print*,'- INPUT DATA FROM SPECTRAL GFS SIGIO/SFCIO FILE.'
299 #endif
300  case ("gaussian_netcdf")
301  print*,'- INPUT DATA FROM FV3 GAUSSIAN NETCDF FILE.'
302  case ("grib2")
303  print*,'- INPUT DATA FROM A GRIB2 FILE'
304  case default
305  call error_handler("UNRECOGNIZED INPUT DATA TYPE.", 1)
306  end select
307 
308 !-------------------------------------------------------------------------
309 ! Ensure proper file variable provided for grib2 input
310 !-------------------------------------------------------------------------
311 
312  if (trim(input_type) == "grib2") then
313  if (trim(grib2_file_input_grid) == "NULL" .or. trim(grib2_file_input_grid) == "") then
314  call error_handler("FOR GRIB2 DATA, PLEASE PROVIDE GRIB2_FILE_INPUT_GRID", 1)
315  endif
316  endif
317 
318  !-------------------------------------------------------------------------
319 ! For grib2 input, warn about possibly unsupported external model types
320 !-------------------------------------------------------------------------
321 
322  if (trim(input_type) == "grib2") then
323  if (.not. any((/character(4)::"GFS","NAM","RAP","HRRR","RRFS"/)==trim(external_model))) then
324  call error_handler( "KNOWN SUPPORTED external_model INPUTS ARE GFS, NAM, RAP, HRRR, AND RRFS. " // &
325  "IF YOU WISH TO PROCESS GRIB2 DATA FROM ANOTHER MODEL, YOU MAY ATTEMPT TO DO SO AT YOUR OWN RISK. " // &
326  "ONE WAY TO DO THIS IS PROVIDE NAM FOR external_model AS IT IS A RELATIVELY STRAIGHT-" // &
327  "FORWARD REGIONAL GRIB2 FILE. YOU MAY ALSO COMMENT OUT THIS ERROR MESSAGE IN " // &
328  "program_setup.f90 LINE 389. NO GUARANTEE IS PROVIDED THAT THE CODE WILL WORK OR "// &
329  "THAT THE RESULTING DATA WILL BE CORRECT OR WORK WITH THE ATMOSPHERIC MODEL.", 1)
330  endif
331  endif
332 
333 !-------------------------------------------------------------------------
334 ! For grib2 hrrr input without geogrid file input, warn that soil moisture interpolation
335 ! will be less accurate
336 !-------------------------------------------------------------------------
337 
338  if (trim(input_type) == "grib2" .and. trim(external_model)=="HRRR") then
339  if (trim(geogrid_file_input_grid) == "NULL" .or. trim(grib2_file_input_grid) == "") then
340  print*, "HRRR DATA DOES NOT CONTAIN SOIL TYPE INFORMATION. WITHOUT"
341  print*, "GEOGRID_FILE_INPUT_GRID SPECIFIED, SOIL MOISTURE INTERPOLATION MAY BE LESS ACCURATE."
342  endif
343  endif
344 
345  if (trim(thomp_mp_climo_file) /= "NULL") then
346  use_thomp_mp_climo=.true.
347  print*,"- WILL PROCESS CLIMO THOMPSON MP TRACERS FROM FILE: ", trim(thomp_mp_climo_file)
348  endif
349 
350  return
351 
352  end subroutine read_setup_namelist
353 
378 subroutine read_varmap
380  implicit none
381 
382  integer :: istat, k, nvars
383  character(len=500) :: line
384  character(len=20),allocatable :: var_type(:)
385 
386  if (trim(input_type) == "grib2") then
387 
388  print*,"OPEN VARIABLE MAPPING FILE: ", trim(varmap_file)
389  open(14, file=trim(varmap_file), form='formatted', iostat=istat)
390  if (istat /= 0) then
391  call error_handler("OPENING VARIABLE MAPPING FILE", istat)
392  endif
393 
395  nvars = 0
396 
397  !Loop over lines of file to count the number of variables
398  do
399  read(14, '(A)', iostat=istat) line !chgres_var_names_tmp(k)!, field_var_names(k) , &
400  ! missing_var_methods(k), missing_var_values(k), var_type(k)
401  if (istat/=0) exit
402  if ( trim(line) .eq. '' ) cycle
403  nvars = nvars+1
404  enddo
405  if ( nvars == 0) call error_handler("VARMAP FILE IS EMPTY.", -1)
406 
407  allocate(chgres_var_names(nvars))
408  allocate(field_var_names(nvars))
409  allocate(missing_var_methods(nvars))
410  allocate(missing_var_values(nvars))
411  allocate(read_from_input(nvars))
412  allocate(var_type(nvars))
413 
414  read_from_input(:) = .true.
415  rewind(14)
416  do k = 1,nvars
417  read(14, *, iostat=istat) chgres_var_names(k), field_var_names(k) , &
418  missing_var_methods(k), missing_var_values(k), var_type(k)
419  if (istat /= 0) call error_handler("READING VARIABLE MAPPING FILE", istat)
420  if(trim(var_type(k))=='T') then
423  if ((trim(chgres_var_names(k)) == "ice_aero" .or. trim(chgres_var_names(k)) == "liq_aero") .and. &
424  trim(thomp_mp_climo_file) .ne. "NULL" .and. trim(input_type) == "grib2") then
425  call error_handler("VARMAP TABLE CONTAINS TRACER ENTRIES FOR THOMPSON AEROSOLS liq_aero or "// &
426  "ice_aero. REMOVE THESE ENTRIES OR REMOVE THE NAMELIST ENTRY FOR "// &
427  "thomp_mp_climo_file AND TRY AGAIN.",1)
428  endif
429  endif
430  enddo
431  close(14)
433  endif
434 end subroutine read_varmap
435 
448 subroutine get_var_cond(var_name,this_miss_var_method,this_miss_var_value, &
449  this_field_var_name, loc)
450 
451  implicit none
452  character(len=20), intent(in) :: var_name
453 
454  character(len=20), optional, intent(out) :: this_miss_var_method, &
455  this_field_var_name
456  real(esmf_kind_r4), optional, intent(out):: this_miss_var_value
457 
458  integer, optional, intent(out) :: loc
459 
460  integer :: i, tmp(size(missing_var_methods))
461 
462  i=0
463 
464  tmp(:)=0
465  where(chgres_var_names==var_name) tmp=1
466 
467  i = maxloc(merge(1.,0.,chgres_var_names == var_name),dim=1) !findloc(chgres_var_names,var_name)
468  print*, i
469  if (maxval(tmp).eq.0) then
470  print*, "WARNING: NO ENTRY FOR ", trim(var_name), " IN VARMAP TABLE. WILL SKIP " // &
471  "VARIABLE IF NOT FOUND IN EXTERNAL MODEL FILE"
472 
473  if(present(this_miss_var_method)) this_miss_var_method = "skip"
474  if(present(this_miss_var_value)) this_miss_var_value = -9999.9_esmf_kind_r4
475  if(present(this_field_var_name)) this_field_var_name = "NULL"
476  if(present(loc)) loc = 9999
477  else
478  if(present(this_miss_var_method)) this_miss_var_method = missing_var_methods(i)
479  if(present(this_miss_var_value)) this_miss_var_value = missing_var_values(i)
480  if(present(this_field_var_name)) this_field_var_name = field_var_names(i)
481  if(present(loc)) loc = i
482  endif
483 
484 end subroutine get_var_cond
485 
519  subroutine calc_soil_params_driver(localpet)
521  implicit none
522 
523  integer, intent(in) :: localpet
524 
525  integer, parameter :: num_statsgo = 16
526  real, parameter :: smlow_statsgo = 0.5
527  real, parameter :: smhigh_statsgo = 6.0
528 
529 ! zobler soil type used by spectral gfs prior to June 2017.
530  integer, parameter :: num_zobler = 9
531  real, parameter :: smlow_zobler = 0.5
532  real, parameter :: smhigh_zobler = 6.0
533 
534  integer :: num_soil_cats
535 
536  real :: bb_statsgo(num_statsgo)
537  real :: maxsmc_statsgo(num_statsgo)
538  real :: satdk_statsgo(num_statsgo)
539  real :: satpsi_statsgo(num_statsgo)
540 
541  real :: bb_zobler(num_zobler)
542  real :: maxsmc_zobler(num_zobler)
543  real :: satdk_zobler(num_zobler)
544  real :: satpsi_zobler(num_zobler)
545 
546  real, allocatable :: bb(:)
547  real :: smlow, smhigh
548  real, allocatable :: satdk(:)
549  real, allocatable :: satpsi(:)
550  real, allocatable :: satdw(:)
551 
552 ! using stasgo table
553  data bb_statsgo /4.05, 4.26, 4.74, 5.33, 5.33, 5.25, &
554  6.77, 8.72, 8.17, 10.73, 10.39, 11.55, &
555  5.25, -9.99, 4.05, 4.26/
556 
557  data maxsmc_statsgo /0.395, 0.421, 0.434, 0.476, 0.476, 0.439, &
558  0.404, 0.464, 0.465, 0.406, 0.468, 0.457, &
559  0.464, -9.99, 0.200, 0.421/
560 
561  data satdk_statsgo /1.7600e-4, 1.4078e-5, 5.2304e-6, 2.8089e-6, 2.8089e-6, &
562  3.3770e-6, 4.4518e-6, 2.0348e-6, 2.4464e-6, 7.2199e-6, &
563  1.3444e-6, 9.7384e-7, 3.3770e-6, -9.99, 1.4078e-5, &
564  1.4078e-5/
565 
566  data satpsi_statsgo /0.0350, 0.0363, 0.1413, 0.7586, 0.7586, 0.3548, &
567  0.1349, 0.6166, 0.2630, 0.0977, 0.3236, 0.4677, &
568  0.3548, -9.99, 0.0350, 0.0363/
569 
570  data bb_zobler /4.26, 8.72, 11.55, 4.74, 10.73, 8.17, &
571  6.77, 5.25, 4.26/
572 
573  data maxsmc_zobler /0.421, 0.464, 0.468, 0.434, 0.406, 0.465, &
574  0.404, 0.439, 0.421/
575 
576  data satdk_zobler /1.41e-5, 0.20e-5, 0.10e-5, 0.52e-5, 0.72e-5, &
577  0.25e-5, 0.45e-5, 0.34e-5, 1.41e-5/
578 
579  data satpsi_zobler /0.040, 0.620, 0.470, 0.140, 0.100, 0.260, &
580  0.140, 0.360, 0.040/
581 
582 !-------------------------------------------------------------------------
583 ! Compute soil parameters for the input grid.
584 !-------------------------------------------------------------------------
585 
586  select case (trim(input_type))
587  case ("gfs_sigio")
588  print*,'- INPUT GRID USED ZOBLER SOIL TYPES.'
589  num_soil_cats = num_zobler
590  case default
591  print*,'- INPUT GRID USED STATSGO SOIL TYPES.'
592  num_soil_cats = num_statsgo
593  end select
594 
595  allocate(maxsmc_input(num_soil_cats))
596  allocate(wltsmc_input(num_soil_cats))
597  allocate(drysmc_input(num_soil_cats))
598  allocate(refsmc_input(num_soil_cats))
599  allocate(bb(num_soil_cats))
600  allocate(satdk(num_soil_cats))
601  allocate(satpsi(num_soil_cats))
602  allocate(satdw(num_soil_cats))
603 
604  select case (trim(input_type))
605  case ("gfs_sigio")
606  smlow = smlow_zobler
607  smhigh = smhigh_zobler
608  maxsmc_input = maxsmc_zobler
609  bb = bb_zobler
610  satdk = satdk_zobler
611  satpsi = satpsi_zobler
612  case default
613  smlow = smlow_statsgo
614  smhigh = smhigh_statsgo
615  maxsmc_input = maxsmc_statsgo
616  bb = bb_statsgo
617  satdk = satdk_statsgo
618  satpsi = satpsi_statsgo
619  end select
620 
621  call calc_soil_params(num_soil_cats, smlow, smhigh, satdk, maxsmc_input, &
622  bb, satpsi, satdw, refsmc_input, drysmc_input, wltsmc_input)
623 
624  deallocate(bb, satdk, satpsi, satdw)
625 
626  if (localpet == 0) print*,'maxsmc input grid ',maxsmc_input
627  if (localpet == 0) print*,'wltsmc input grid ',wltsmc_input
628 
629 !-------------------------------------------------------------------------
630 ! Compute soil parameters for the target grid.
631 !-------------------------------------------------------------------------
632 
633  print*,'- TARGET GRID USEING STATSGO SOIL TYPES.'
634 
635  num_soil_cats = num_statsgo
636 
637  allocate(maxsmc_target(num_soil_cats))
638  allocate(wltsmc_target(num_soil_cats))
639  allocate(drysmc_target(num_soil_cats))
640  allocate(refsmc_target(num_soil_cats))
641  allocate(bb_target(num_soil_cats))
642  allocate(satpsi_target(num_soil_cats))
643  allocate(satdk(num_soil_cats))
644  allocate(satdw(num_soil_cats))
645 
646  smlow = smlow_statsgo
647  smhigh = smhigh_statsgo
648  maxsmc_target = maxsmc_statsgo
649  bb_target = bb_statsgo
650  satdk = satdk_statsgo
651  satpsi_target = satpsi_statsgo
652 
653  call calc_soil_params(num_soil_cats, smlow, smhigh, satdk, maxsmc_target, &
655 
656  deallocate(satdk, satdw)
657 
658  if (localpet == 0) print*,'maxsmc target grid ',maxsmc_target
659  if (localpet == 0) print*,'wltsmc input grid ',wltsmc_target
660 
661  end subroutine calc_soil_params_driver
662 
679  subroutine calc_soil_params(num_soil_cats, smlow, smhigh, satdk, &
680  maxsmc, bb, satpsi, satdw, refsmc, drysmc, wltsmc)
682  implicit none
683 
684  integer, intent(in) :: num_soil_cats
685 
686  real, intent(in) :: smlow, smhigh
687  real, intent(in) :: bb(num_soil_cats)
688  real, intent(in) :: maxsmc(num_soil_cats)
689  real, intent(in) :: satdk(num_soil_cats)
690  real, intent(in) :: satpsi(num_soil_cats)
691 
692  real, intent(out) :: satdw(num_soil_cats)
693  real, intent(out) :: refsmc(num_soil_cats)
694  real, intent(out) :: drysmc(num_soil_cats)
695  real, intent(out) :: wltsmc(num_soil_cats)
696 
697  integer :: i
698 
699  real :: refsmc1
700  real :: wltsmc1
701 
702  satdw = 0.0
703  refsmc = 0.0
704  wltsmc = 0.0
705  drysmc = 0.0
706 
707  do i = 1, num_soil_cats
708 
709  if (maxsmc(i) > 0.0) then
710 
711  satdw(i) = bb(i)*satdk(i)*(satpsi(i)/maxsmc(i))
712  refsmc1 = maxsmc(i)*(5.79e-9/satdk(i)) **(1.0/(2.0*bb(i)+3.0))
713  refsmc(i) = refsmc1 + (maxsmc(i)-refsmc1) / smhigh
714  wltsmc1 = maxsmc(i) * (200.0/satpsi(i))**(-1.0/bb(i))
715  wltsmc(i) = wltsmc1 - smlow * wltsmc1
716 
717 !----------------------------------------------------------------------
718 ! CURRENT VERSION DRYSMC VALUES THAT EQUATE TO WLTSMC.
719 ! FUTURE VERSION COULD LET DRYSMC BE INDEPENDENTLY SET VIA NAMELIST.
720 !----------------------------------------------------------------------
721 
722  drysmc(i) = wltsmc(i)
723 
724  end if
725 
726  END DO
727 
728  end subroutine calc_soil_params
729 
730  end module program_setup
character(len=500), public fix_dir_target_grid
Directory containing target grid pre-computed fixed data (ex: soil type).
This module contains code to read the setup namelist file, handle the varmap file for GRIB2 data...
character(len=500), dimension(6), public atm_tracer_files_input_grid
File names of input atmospheric restart tracer files.
integer, public num_tracers_input
Number of atmospheric tracers in input file.
character(len=500), public nst_files_input_grid
File name of input nst data.
character(len=500), public varmap_file
REQUIRED.
real, dimension(:), allocatable, public wltsmc_input
Plant wilting point soil moisture content input grid.
integer, public cycle_mon
Cycle month.
logical, public lai_from_climo
If false, interpolate leaf area index from the input data to the target grid instead of using data fr...
integer, public regional
For regional target grids.
character(len=20), dimension(max_tracers), public tracers
Name of each atmos tracer to be processed.
real, dimension(:), allocatable, public satpsi_target
Saturated soil potential, target grid.
real, dimension(:), allocatable, public maxsmc_input
Maximum soil moisture content input grid.
integer, public cycle_year
Cycle year.
integer, public nsoill_out
Number of soil levels desired in the output data.
character(len=20), dimension(max_tracers), public tracers_input
Name of each atmos tracer record in the input file.
real, dimension(:), allocatable, public bb_target
Soil 'b' parameter, target grid.
subroutine, public read_varmap
Reads the variable mapping table, which is required for initializing with GRIB2 data.
integer, public halo_bndy
Number of row/cols of lateral halo, where pure lateral bndy conditions are applied (regional target g...
subroutine, public get_var_cond(var_name, this_miss_var_method, this_miss_var_value, this_field_var_name, loc)
Search the variable mapping table to find conditions for handling missing variables.
logical, public sotyp_from_climo
If false, interpolate soil type from the input data to the target grid instead of using data from sta...
integer, public cycle_day
Cycle day.
logical, public minmax_vgfrc_from_climo
If false, interpolate min/max vegetation fraction from the input data to the target grid instead of u...
character(len=500), public thomp_mp_climo_file
Path/name to the Thompson MP climatology file.
character(len=20), dimension(:), allocatable, public missing_var_methods
Method to replace missing GRIB2 input records.
character(len=15), public cres_target_grid
Target grid resolution, i.e., C768.
logical, public convert_sfc
Convert sfc data when true.
character(len=500), public orog_dir_target_grid
Directory containing the target grid orography files.
character(len=500), dimension(6), public orog_files_input_grid
Input grid orography files.
character(len=20), dimension(:), allocatable, public chgres_var_names
Varmap table variable name as recognized by this program.
character(len=20), public external_model
The model that the input data is derived from.
character(len=500), public orog_dir_input_grid
Directory containing the input grid orography files.
logical, public wam_cold_start
When true, cold start for whole atmosphere model.
subroutine calc_soil_params(num_soil_cats, smlow, smhigh, satdk, maxsmc, bb, satpsi, satdw, refsmc, drysmc, wltsmc)
Compute soil parameters.
character(len=500), public mosaic_file_target_grid
Target grid mosaic file.
character(len=500), public mosaic_file_input_grid
Input grid mosaic file.
logical, public convert_nst
Convert nst data when true.
character(len=500), dimension(6), public atm_files_input_grid
File names of input atmospheric data.
character(len=500), public vcoord_file_target_grid
Vertical coordinate definition file.
character(len=500), dimension(6), public orog_files_target_grid
Target grid orography files.
logical, public tg3_from_soil
If false, use lowest level soil temperature for the base soil temperature instead of using data from ...
character(len=20), dimension(:), allocatable, public field_var_names
The GRIB2 variable name in the varmap table.
logical, public convert_atm
Convert atmospheric data when true.
integer, parameter, public max_tracers
Maximum number of atmospheric tracers processed.
real, dimension(:), allocatable, public drysmc_input
Air dry soil moisture content input grid.
character(len=500), public geogrid_file_input_grid
Name of "geogrid" file, which contains static surface fields on the input grid.
real, dimension(:), allocatable, public wltsmc_target
Plant wilting point soil moisture content target grid.
character(len=500), public atm_weight_file
File containing pre-computed weights to horizontally interpolate atmospheric fields.
logical, public vgfrc_from_climo
If false, interpolate vegetation fraction from the input data to the target grid instead of using dat...
subroutine, public read_setup_namelist(filename)
Reads program configuration namelist.
subroutine, public calc_soil_params_driver(localpet)
Driver routine to compute soil parameters for each soil type.
character(len=500), public data_dir_input_grid
Directory containing input atm or sfc files.
character(len=25), public input_type
Input data type:
character(len=500), dimension(7), public atm_core_files_input_grid
File names of input atmospheric restart core files.
integer, public num_tracers
Number of atmospheric tracers to be processed.
real, dimension(:), allocatable, public refsmc_target
Reference soil moisture content target grid (onset of soil moisture stress).
character(len=500), public wam_parm_file
Full path to msis21.parm for WAM initialization.
character(len=500), public grib2_file_input_grid
REQUIRED.
logical, public use_thomp_mp_climo
When true, read and process Thompson MP climatological tracers.
logical, public vgtyp_from_climo
If false, interpolate vegetation type from the input data to the target grid instead of using data fr...
integer, public cycle_hour
Cycle hour.
logical, dimension(:), allocatable, public read_from_input
When false, variable was not read from GRIB2 input file.
real(kind=esmf_kind_r4), dimension(:), allocatable, public missing_var_values
If input GRIB2 record is missing, the variable is set to this value.
integer, public halo_blend
Number of row/cols of blending halo, where model tendencies and lateral boundary tendencies are appli...
character(len=500), dimension(6), public sfc_files_input_grid
File names containing input surface data.
real, dimension(:), allocatable, public refsmc_input
Reference soil moisture content input grid (onset of soil moisture stress).
real, dimension(:), allocatable, public maxsmc_target
Maximum soil moisture content target grid.
real, dimension(:), allocatable, public drysmc_target
Air dry soil moisture content target grid.