chgres_cube  1.3.0
 All Data Structures Files Functions Variables
program_setup.F90
Go to the documentation of this file.
1 
4 
9  module program_setup
10 
11  implicit none
12 
13  private
14 
15  character(len=500), public :: varmap_file = "NULL"
16  character(len=500), public :: atm_files_input_grid(6) = "NULL"
20  character(len=500), public :: atm_core_files_input_grid(7) = "NULL"
21  character(len=500), public :: atm_tracer_files_input_grid(6) = "NULL"
22  character(len=500), public :: data_dir_input_grid = "NULL"
23  character(len=500), public :: fix_dir_target_grid = "NULL"
24  character(len=500), public :: mosaic_file_input_grid = "NULL"
25  character(len=500), public :: mosaic_file_target_grid = "NULL"
26  character(len=500), public :: nst_files_input_grid = "NULL"
27  character(len=500), public :: grib2_file_input_grid = "NULL"
28  character(len=500), public :: geogrid_file_input_grid = "NULL"
31  character(len=500), public :: orog_dir_input_grid = "NULL"
32  character(len=500), public :: orog_files_input_grid(6) = "NULL"
33  character(len=500), public :: orog_dir_target_grid = "NULL"
34  character(len=500), public :: orog_files_target_grid(6) = "NULL"
35  character(len=500), public :: sfc_files_input_grid(6) = "NULL"
36  character(len=500), public :: vcoord_file_target_grid = "NULL"
37  character(len=500), public :: thomp_mp_climo_file= "NULL"
38  character(len=6), public :: cres_target_grid = "NULL"
39  character(len=500), public :: atm_weight_file="NULL"
40  character(len=25), public :: input_type="restart"
54  character(len=20), public :: external_model="GFS"
55 
56  character(len=500), public :: fix_dir_input_grid = "NULL"
58 
59 
60  integer, parameter, public :: max_tracers=100
61  integer, public :: num_tracers
62  integer, public :: num_tracers_input
63 
64  logical, allocatable, public :: read_from_input(:)
66 
67  character(len=20), public :: tracers(max_tracers)="NULL"
73  character(len=20), public :: tracers_input(max_tracers)="NULL"
78  character(len=20), allocatable, public :: missing_var_methods(:)
80  character(len=20), allocatable, public :: chgres_var_names(:)
82  character(len=20), allocatable, public :: field_var_names(:)
83 
84 
85  integer, public :: cycle_mon = -999
86  integer, public :: cycle_day = -999
87  integer, public :: cycle_hour = -999
88  integer, public :: regional = 0
90  integer, public :: halo_bndy = 0
91  integer, public :: halo_blend = 0
92  integer, public :: nsoill_out = 4
93 
94  logical, public :: convert_atm = .false.
95  logical, public :: convert_nst = .false.
96  logical, public :: convert_sfc = .false.
97 
98  ! Options for replacing vegetation/soil type, veg fraction, and lai with data from the grib2 file
99  ! Default is to use climatology instead
100  logical, public :: vgtyp_from_climo = .true.
104  logical, public :: sotyp_from_climo = .true.
109  logical, public :: vgfrc_from_climo = .true.
113 
114  logical, public :: minmax_vgfrc_from_climo = .true.
118  logical, public :: lai_from_climo = .true.
121  logical, public :: tg3_from_soil = .false.
124  logical, public :: use_thomp_mp_climo=.false.
125 
126  real, allocatable, public :: drysmc_input(:)
127  real, allocatable, public :: drysmc_target(:)
128  real, allocatable, public :: maxsmc_input(:)
129  real, allocatable, public :: maxsmc_target(:)
130  real, allocatable, public :: refsmc_input(:)
131  real, allocatable, public :: refsmc_target(:)
132  real, allocatable, public :: wltsmc_input(:)
133  real, allocatable, public :: wltsmc_target(:)
134  real, allocatable, public :: bb_target(:)
135  real, allocatable, public :: satpsi_target(:)
136  real, allocatable, public :: missing_var_values(:)
138 
139 
140  public :: read_setup_namelist
141  public :: calc_soil_params_driver
142  public :: read_varmap
143  public :: get_var_cond
144 
145  contains
146 
152  subroutine read_setup_namelist(filename)
153  implicit none
154 
155  character(len=*), intent(in), optional :: filename
156  character(:), allocatable :: filename_to_use
157 
158 
159  integer :: is, ie, ierr
160 
161 
162  namelist /config/ varmap_file, &
163  mosaic_file_target_grid, &
164  fix_dir_target_grid, &
165  orog_dir_target_grid, &
166  orog_files_target_grid, &
167  mosaic_file_input_grid, &
168  orog_dir_input_grid, &
169  orog_files_input_grid, &
170  nst_files_input_grid, &
171  sfc_files_input_grid, &
172  atm_files_input_grid, &
173  atm_core_files_input_grid, &
174  atm_tracer_files_input_grid, &
175  grib2_file_input_grid, &
176  geogrid_file_input_grid, &
177  data_dir_input_grid, &
178  vcoord_file_target_grid, &
179  cycle_mon, cycle_day, &
180  cycle_hour, convert_atm, &
181  convert_nst, convert_sfc, &
182  vgtyp_from_climo, &
183  sotyp_from_climo, &
184  vgfrc_from_climo, &
185  minmax_vgfrc_from_climo, &
186  lai_from_climo, tg3_from_soil, &
187  regional, input_type, &
188  external_model, &
189  atm_weight_file, tracers, &
190  tracers_input, &
191  halo_bndy, &
192  halo_blend, &
193  fix_dir_input_grid, &
194  nsoill_out, &
195  thomp_mp_climo_file
196 
197  print*,"- READ SETUP NAMELIST"
198 
199  if (present(filename)) then
200  filename_to_use = filename
201  else
202  filename_to_use = "./fort.41"
203  endif
204 
205  open(41, file=filename_to_use, iostat=ierr)
206  if (ierr /= 0) call error_handler("OPENING SETUP NAMELIST.", ierr)
207  read(41, nml=config, iostat=ierr)
208  if (ierr /= 0) call error_handler("READING SETUP NAMELIST.", ierr)
209  close (41)
210 
211  call to_lower(input_type)
212 
213  orog_dir_target_grid = trim(orog_dir_target_grid) // '/'
214  orog_dir_input_grid = trim(orog_dir_input_grid) // '/'
215 
216 !-------------------------------------------------------------------------
217 ! Determine CRES of target grid from the name of the mosaic file.
218 !-------------------------------------------------------------------------
219 
220  is = index(mosaic_file_target_grid, "/", .true.)
221  ie = index(mosaic_file_target_grid, "mosaic") - 1
222 
223  if (is == 0 .or. ie == 0) then
224  call error_handler("CANT DETERMINE CRES FROM MOSAIC FILE.", 1)
225  endif
226 
227  cres_target_grid = mosaic_file_target_grid(is+1:ie-1)
228 
229  if (.not. convert_sfc .and. .not. convert_atm) then
230  call error_handler("MUST CONVERT EITHER AN ATM OR SFC FILE.", 1)
231  endif
232 
233 !-------------------------------------------------------------------------
234 ! Flag for processing stand-alone regional grid. When '1',
235 ! remove halo from atmospheric and surface data and output
236 ! atmospheric lateral boundary condition file. When '2',
237 ! create lateral boundary file only. When '0' (the default),
238 ! process normally as a global grid.
239 !-------------------------------------------------------------------------
240 
241  if (regional > 0) then
242  print*,"- PROCESSING A REGIONAL NEST WITH A BOUNDARY HALO OF ",halo_bndy
243  print*,"- PROCESSING A REGIONAL NEST WITH A BLENDING HALO OF ",halo_blend
244  else
245  halo_bndy = 0
246  halo_blend = 0
247  endif
248 
249  num_tracers = 0
250  do is = 1, max_tracers
251  if (trim(tracers(is)) == "NULL") exit
252  num_tracers = num_tracers + 1
253  print*,"- WILL PROCESS TRACER ", trim(tracers(is))
254  enddo
255 
256  num_tracers_input = 0
257  do is = 1, max_tracers
258  if (trim(tracers_input(is)) == "NULL") exit
259  num_tracers_input = num_tracers_input + 1
260  print*,"- WILL PROCESS INPUT TRACER ", trim(tracers_input(is))
261  enddo
262 
263 !-------------------------------------------------------------------------
264 ! Ensure program recognizes the input data type.
265 !-------------------------------------------------------------------------
266 
267  select case (trim(input_type))
268  case ("restart")
269  print*,'- INPUT DATA FROM FV3 TILED RESTART FILES.'
270  case ("history")
271  print*,'- INPUT DATA FROM FV3 TILED HISTORY FILES.'
272  case ("gaussian_nemsio")
273  print*,'- INPUT DATA FROM FV3 GAUSSIAN NEMSIO FILE.'
274  case ("gfs_gaussian_nemsio")
275  print*,'- INPUT DATA FROM SPECTRAL GFS GAUSSIAN NEMSIO FILE.'
276  case ("gfs_sigio")
277  print*,'- INPUT DATA FROM SPECTRAL GFS SIGIO/SFCIO FILE.'
278  case ("gaussian_netcdf")
279  print*,'- INPUT DATA FROM FV3 GAUSSIAN NETCDF FILE.'
280  case ("grib2")
281  print*,'- INPUT DATA FROM A GRIB2 FILE'
282  case default
283  call error_handler("UNRECOGNIZED INPUT DATA TYPE.", 1)
284  end select
285 
286 !-------------------------------------------------------------------------
287 ! Ensure proper file variable provided for grib2 input
288 !-------------------------------------------------------------------------
289 
290  if (trim(input_type) == "grib2") then
291  if (trim(grib2_file_input_grid) == "NULL" .or. trim(grib2_file_input_grid) == "") then
292  call error_handler("FOR GRIB2 DATA, PLEASE PROVIDE GRIB2_FILE_INPUT_GRID", 1)
293  endif
294  endif
295 
296  !-------------------------------------------------------------------------
297 ! For grib2 input, warn about possibly unsupported external model types
298 !-------------------------------------------------------------------------
299 
300  if (trim(input_type) == "grib2") then
301  if (.not. any((/character(4)::"GFS","NAM","RAP","HRRR"/)==trim(external_model))) then
302  call error_handler( "KNOWN SUPPORTED external_model INPUTS ARE GFS, NAM, RAP, AND HRRR. " // &
303  "IF YOU WISH TO PROCESS GRIB2 DATA FROM ANOTHER MODEL, YOU MAY ATTEMPT TO DO SO AT YOUR OWN RISK. " // &
304  "ONE WAY TO DO THIS IS PROVIDE NAM FOR external_model AS IT IS A RELATIVELY STRAIGHT-" // &
305  "FORWARD REGIONAL GRIB2 FILE. YOU MAY ALSO COMMENT OUT THIS ERROR MESSAGE IN " // &
306  "program_setup.f90 LINE 389. NO GUARANTEE IS PROVIDED THAT THE CODE WILL WORK OR "// &
307  "THAT THE RESULTING DATA WILL BE CORRECT OR WORK WITH THE ATMOSPHERIC MODEL.", 1)
308  endif
309  endif
310 
311 !-------------------------------------------------------------------------
312 ! For grib2 hrrr input without geogrid file input, warn that soil moisture interpolation
313 ! will be less accurate
314 !-------------------------------------------------------------------------
315 
316  if (trim(input_type) == "grib2" .and. trim(external_model)=="HRRR") then
317  if (trim(geogrid_file_input_grid) == "NULL" .or. trim(grib2_file_input_grid) == "") then
318  print*, "HRRR DATA DOES NOT CONTAIN SOIL TYPE INFORMATION. WITHOUT &
319  GEOGRID_FILE_INPUT_GRID SPECIFIED, SOIL MOISTURE INTERPOLATION MAY BE LESS &
320  ACCURATE. "
321  endif
322  endif
323 
324  if (trim(thomp_mp_climo_file) /= "NULL") then
325  use_thomp_mp_climo=.true.
326  print*,"- WILL PROCESS CLIMO THOMPSON MP TRACERS FROM FILE: ", trim(thomp_mp_climo_file)
327  endif
328 
329  return
330 
331  end subroutine read_setup_namelist
332 
338 subroutine read_varmap
339 
340  implicit none
341 
342  integer :: istat, k, nvars
343  character(len=500) :: line
344  character(len=20),allocatable :: var_type(:)
345 
346  if (trim(input_type) == "grib2") then
347 
348  print*,"OPEN VARIABLE MAPPING FILE: ", trim(varmap_file)
349  open(14, file=trim(varmap_file), form='formatted', iostat=istat)
350  if (istat /= 0) then
351  call error_handler("OPENING VARIABLE MAPPING FILE", istat)
352  endif
353 
354  num_tracers = 0
355  nvars = 0
356 
357  !Loop over lines of file to count the number of variables
358  do
359  read(14, '(A)', iostat=istat) line !chgres_var_names_tmp(k)!, field_var_names(k) , &
360  ! missing_var_methods(k), missing_var_values(k), var_type(k)
361  if (istat/=0) exit
362  if ( trim(line) .eq. '' ) cycle
363  nvars = nvars+1
364  enddo
365  if ( nvars == 0) call error_handler("VARMAP FILE IS EMPTY.", -1)
366 
367  allocate(chgres_var_names(nvars))
368  allocate(field_var_names(nvars))
369  allocate(missing_var_methods(nvars))
370  allocate(missing_var_values(nvars))
371  allocate(read_from_input(nvars))
372  allocate(var_type(nvars))
373 
374  read_from_input(:) = .true.
375  rewind(14)
376  do k = 1,nvars
377  read(14, *, iostat=istat) chgres_var_names(k), field_var_names(k) , &
378  missing_var_methods(k), missing_var_values(k), var_type(k)
379  if (istat /= 0) call error_handler("READING VARIABLE MAPPING FILE", istat)
380  if(trim(var_type(k))=='T') then
381  num_tracers = num_tracers + 1
382  tracers_input(num_tracers)=chgres_var_names(k)
383  if ((trim(chgres_var_names(k)) == "ice_aero" .or. trim(chgres_var_names(k)) == "liq_aero") .and. &
384  trim(thomp_mp_climo_file) .ne. "NULL" .and. trim(input_type) == "grib2") then
385  call error_handler("VARMAP TABLE CONTAINS TRACER ENTRIES FOR THOMPSON AEROSOLS liq_aero or "// &
386  "ice_aero. REMOVE THESE ENTRIES OR REMOVE THE NAMELIST ENTRY FOR "// &
387  "thomp_mp_climo_file AND TRY AGAIN.",1)
388  endif
389  endif
390  enddo
391  close(14)
392  endif
393 end subroutine read_varmap
394 
407 subroutine get_var_cond(var_name,this_miss_var_method,this_miss_var_value, &
408  this_field_var_name, loc)
409  use esmf
410 
411  implicit none
412  character(len=20), intent(in) :: var_name
413 
414  character(len=20), optional, intent(out) :: this_miss_var_method, &
415  this_field_var_name
416  real(esmf_kind_r4), optional, intent(out):: this_miss_var_value
417 
418  integer, optional, intent(out) :: loc
419 
420  integer :: i, tmp(size(missing_var_methods))
421 
422  i=0
423 
424  tmp(:)=0
425  where(chgres_var_names==var_name) tmp=1
426 
427  i = maxloc(merge(1.,0.,chgres_var_names == var_name),dim=1) !findloc(chgres_var_names,var_name)
428  print*, i
429  if (maxval(tmp).eq.0) then
430  print*, "WARNING: NO ENTRY FOR ", trim(var_name), " IN VARMAP TABLE. WILL SKIP " // &
431  "VARIABLE IF NOT FOUND IN EXTERNAL MODEL FILE"
432 
433  if(present(this_miss_var_method)) this_miss_var_method = "skip"
434  if(present(this_miss_var_value)) this_miss_var_value = -9999.9_esmf_kind_r4
435  if(present(this_field_var_name)) this_field_var_name = "NULL"
436  if(present(loc)) loc = 9999
437  else
438  if(present(this_miss_var_method)) this_miss_var_method = missing_var_methods(i)
439  if(present(this_miss_var_value)) this_miss_var_value = missing_var_values(i)
440  if(present(this_field_var_name)) this_field_var_name = field_var_names(i)
441  if(present(loc)) loc = i
442  endif
443 
444 end subroutine get_var_cond
445 
479  subroutine calc_soil_params_driver(localpet)
480 
481  implicit none
482 
483  integer, intent(in) :: localpet
484 
485  integer, parameter :: num_statsgo = 16
486  real, parameter :: smlow_statsgo = 0.5
487  real, parameter :: smhigh_statsgo = 6.0
488 
489 ! zobler soil type used by spectral gfs prior to June 2017.
490  integer, parameter :: num_zobler = 9
491  real, parameter :: smlow_zobler = 0.5
492  real, parameter :: smhigh_zobler = 6.0
493 
494  integer :: num_soil_cats
495 
496  real :: bb_statsgo(num_statsgo)
497  real :: maxsmc_statsgo(num_statsgo)
498  real :: satdk_statsgo(num_statsgo)
499  real :: satpsi_statsgo(num_statsgo)
500 
501  real :: bb_zobler(num_zobler)
502  real :: maxsmc_zobler(num_zobler)
503  real :: satdk_zobler(num_zobler)
504  real :: satpsi_zobler(num_zobler)
505 
506  real, allocatable :: bb(:)
507  real :: smlow, smhigh
508  real, allocatable :: satdk(:)
509  real, allocatable :: satpsi(:)
510  real, allocatable :: satdw(:)
511 
512 ! using stasgo table
513  data bb_statsgo /4.05, 4.26, 4.74, 5.33, 5.33, 5.25, &
514  6.77, 8.72, 8.17, 10.73, 10.39, 11.55, &
515  5.25, -9.99, 4.05, 4.26/
516 
517  data maxsmc_statsgo /0.395, 0.421, 0.434, 0.476, 0.476, 0.439, &
518  0.404, 0.464, 0.465, 0.406, 0.468, 0.457, &
519  0.464, -9.99, 0.200, 0.421/
520 
521  data satdk_statsgo /1.7600e-4, 1.4078e-5, 5.2304e-6, 2.8089e-6, 2.8089e-6, &
522  3.3770e-6, 4.4518e-6, 2.0348e-6, 2.4464e-6, 7.2199e-6, &
523  1.3444e-6, 9.7384e-7, 3.3770e-6, -9.99, 1.4078e-5, &
524  1.4078e-5/
525 
526  data satpsi_statsgo /0.0350, 0.0363, 0.1413, 0.7586, 0.7586, 0.3548, &
527  0.1349, 0.6166, 0.2630, 0.0977, 0.3236, 0.4677, &
528  0.3548, -9.99, 0.0350, 0.0363/
529 
530  data bb_zobler /4.26, 8.72, 11.55, 4.74, 10.73, 8.17, &
531  6.77, 5.25, 4.26/
532 
533  data maxsmc_zobler /0.421, 0.464, 0.468, 0.434, 0.406, 0.465, &
534  0.404, 0.439, 0.421/
535 
536  data satdk_zobler /1.41e-5, 0.20e-5, 0.10e-5, 0.52e-5, 0.72e-5, &
537  0.25e-5, 0.45e-5, 0.34e-5, 1.41e-5/
538 
539  data satpsi_zobler /0.040, 0.620, 0.470, 0.140, 0.100, 0.260, &
540  0.140, 0.360, 0.040/
541 
542 !-------------------------------------------------------------------------
543 ! Compute soil parameters for the input grid.
544 !-------------------------------------------------------------------------
545 
546  select case (trim(input_type))
547  case ("gfs_sigio")
548  print*,'- INPUT GRID USED ZOBLER SOIL TYPES.'
549  num_soil_cats = num_zobler
550  case default
551  print*,'- INPUT GRID USED STATSGO SOIL TYPES.'
552  num_soil_cats = num_statsgo
553  end select
554 
555  allocate(maxsmc_input(num_soil_cats))
556  allocate(wltsmc_input(num_soil_cats))
557  allocate(drysmc_input(num_soil_cats))
558  allocate(refsmc_input(num_soil_cats))
559  allocate(bb(num_soil_cats))
560  allocate(satdk(num_soil_cats))
561  allocate(satpsi(num_soil_cats))
562  allocate(satdw(num_soil_cats))
563 
564  select case (trim(input_type))
565  case ("gfs_sigio")
566  smlow = smlow_zobler
567  smhigh = smhigh_zobler
568  maxsmc_input = maxsmc_zobler
569  bb = bb_zobler
570  satdk = satdk_zobler
571  satpsi = satpsi_zobler
572  case default
573  smlow = smlow_statsgo
574  smhigh = smhigh_statsgo
575  maxsmc_input = maxsmc_statsgo
576  bb = bb_statsgo
577  satdk = satdk_statsgo
578  satpsi = satpsi_statsgo
579  end select
580 
581  call calc_soil_params(num_soil_cats, smlow, smhigh, satdk, maxsmc_input, &
582  bb, satpsi, satdw, refsmc_input, drysmc_input, wltsmc_input)
583 
584  deallocate(bb, satdk, satpsi, satdw)
585 
586  if (localpet == 0) print*,'maxsmc input grid ',maxsmc_input
587  if (localpet == 0) print*,'wltsmc input grid ',wltsmc_input
588 
589 !-------------------------------------------------------------------------
590 ! Compute soil parameters for the target grid.
591 !-------------------------------------------------------------------------
592 
593  print*,'- TARGET GRID USEING STATSGO SOIL TYPES.'
594 
595  num_soil_cats = num_statsgo
596 
597  allocate(maxsmc_target(num_soil_cats))
598  allocate(wltsmc_target(num_soil_cats))
599  allocate(drysmc_target(num_soil_cats))
600  allocate(refsmc_target(num_soil_cats))
601  allocate(bb_target(num_soil_cats))
602  allocate(satpsi_target(num_soil_cats))
603  allocate(satdk(num_soil_cats))
604  allocate(satdw(num_soil_cats))
605 
606  smlow = smlow_statsgo
607  smhigh = smhigh_statsgo
608  maxsmc_target = maxsmc_statsgo
609  bb_target = bb_statsgo
610  satdk = satdk_statsgo
611  satpsi_target = satpsi_statsgo
612 
613  call calc_soil_params(num_soil_cats, smlow, smhigh, satdk, maxsmc_target, &
614  bb_target, satpsi_target, satdw, refsmc_target, drysmc_target, wltsmc_target)
615 
616  deallocate(satdk, satdw)
617 
618  if (localpet == 0) print*,'maxsmc target grid ',maxsmc_target
619  if (localpet == 0) print*,'wltsmc input grid ',wltsmc_target
620 
621  end subroutine calc_soil_params_driver
622 
639  subroutine calc_soil_params(num_soil_cats, smlow, smhigh, satdk, &
640  maxsmc, bb, satpsi, satdw, refsmc, drysmc, wltsmc)
641 
642  implicit none
643 
644  integer, intent(in) :: num_soil_cats
645 
646  real, intent(in) :: smlow, smhigh
647  real, intent(in) :: bb(num_soil_cats)
648  real, intent(in) :: maxsmc(num_soil_cats)
649  real, intent(in) :: satdk(num_soil_cats)
650  real, intent(in) :: satpsi(num_soil_cats)
651 
652  real, intent(out) :: satdw(num_soil_cats)
653  real, intent(out) :: refsmc(num_soil_cats)
654  real, intent(out) :: drysmc(num_soil_cats)
655  real, intent(out) :: wltsmc(num_soil_cats)
656 
657  integer :: i
658 
659  real :: refsmc1
660  real :: wltsmc1
661 
662  satdw = 0.0
663  refsmc = 0.0
664  wltsmc = 0.0
665  drysmc = 0.0
666 
667  do i = 1, num_soil_cats
668 
669  if (maxsmc(i) > 0.0) then
670 
671  satdw(i) = bb(i)*satdk(i)*(satpsi(i)/maxsmc(i))
672  refsmc1 = maxsmc(i)*(5.79e-9/satdk(i)) **(1.0/(2.0*bb(i)+3.0))
673  refsmc(i) = refsmc1 + (maxsmc(i)-refsmc1) / smhigh
674  wltsmc1 = maxsmc(i) * (200.0/satpsi(i))**(-1.0/bb(i))
675  wltsmc(i) = wltsmc1 - smlow * wltsmc1
676 
677 !----------------------------------------------------------------------
678 ! CURRENT VERSION DRYSMC VALUES THAT EQUATE TO WLTSMC.
679 ! FUTURE VERSION COULD LET DRYSMC BE INDEPENDENTLY SET VIA NAMELIST.
680 !----------------------------------------------------------------------
681 
682  drysmc(i) = wltsmc(i)
683 
684  end if
685 
686  END DO
687 
688  end subroutine calc_soil_params
689 
690  end module program_setup
subroutine, public calc_soil_params_driver(localpet)
Driver routine to compute soil parameters for each soil type.
subroutine to_lower(strIn)
Convert from upper to lowercase.
Definition: utils.F90:84
subroutine, public read_setup_namelist(filename)
Reads program configuration namelist.
subroutine error_handler(string, rc)
General error handler.
Definition: utils.F90:9
This module contains code to read the setup namelist file, handle the varmap file for GRIB2 data...
subroutine, public read_varmap
Reads the variable mapping table, which is required for initializing with GRIB2 data.
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.
subroutine calc_soil_params(num_soil_cats, smlow, smhigh, satdk, maxsmc, bb, satpsi, satdw, refsmc, drysmc, wltsmc)
Compute soil parameters.