[Dart-dev] DART/branches Revision: 12398
dart at ucar.edu
dart at ucar.edu
Thu Feb 8 12:26:21 MST 2018
thoar at ucar.edu
2018-02-08 12:26:21 -0700 (Thu, 08 Feb 2018)
172
First stab at a routine to ensure that the DATM files have realistic values.
Some of the coupler history files have negative solar flux values ...
physically impossible.
Added: DART/branches/cesm_clm/assimilation_code/programs/forcing_check/forcing_check.f90
===================================================================
--- DART/branches/cesm_clm/assimilation_code/programs/forcing_check/forcing_check.f90 (rev 0)
+++ DART/branches/cesm_clm/assimilation_code/programs/forcing_check/forcing_check.f90 2018-02-08 19:26:21 UTC (rev 12398)
@@ -0,0 +1,540 @@
+! DART software - Copyright UCAR. This open source software is provided
+! by UCAR, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+!
+! $Id$
+
+program forcing_check
+
+! program to take a netCDF file ...
+
+use types_mod, only : r4, r8
+use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, &
+ open_file, close_file, get_next_filename, &
+ find_namelist_in_file, check_namelist_read, &
+ do_nml_file, do_nml_term, nmlfileunit, &
+ initialize_utilities, finalize_utilities
+use parse_args_mod, only : get_args_from_string
+
+use netcdf_utilities_mod, only : nc_check
+
+use netcdf
+
+implicit none
+
+! version controlled file description for error handling, do not edit
+character(len=*), parameter :: source = &
+ '$URL$'
+character(len=*), parameter :: revision = '$Revision$'
+character(len=*), parameter :: revdate = '$Date$'
+
+character(len=*), parameter :: routine = 'forcing_check'
+
+! variables used to read the netcdf info
+integer, parameter :: maxd = 7
+integer :: i, j, ndims, odims, ncrc, etype, nitems, nvars, xtype
+integer :: ncinid1
+integer :: invarid1
+integer :: dimid(maxd), dimlen(maxd), odimid(maxd), odimlen(maxd)
+character(128) :: dimname(maxd), odimname(maxd)
+integer :: nin1Dimensions, nin1Variables, nin1Attributes, in1unlimitedDimID
+
+! arrays for all possible dimensions, real and int
+real(r4) :: r4missing
+real(r4) :: zerod1
+real(r4), allocatable :: oned1(:)
+real(r4), allocatable :: twod1(:,:)
+real(r4), allocatable :: threed1(:,:,:)
+real(r4), allocatable :: fourd1(:,:,:,:)
+real(r4), allocatable :: fived1(:,:,:,:,:)
+real(r4), allocatable :: sixd1(:,:,:,:,:,:)
+real(r4), allocatable :: sevend1(:,:,:,:,:,:,:)
+
+integer :: imissing
+integer :: izerod1
+integer, allocatable :: ioned1(:)
+integer, allocatable :: itwod1(:,:)
+integer, allocatable :: ithreed1(:,:,:)
+integer, allocatable :: ifourd1(:,:,:,:)
+integer, allocatable :: ifived1(:,:,:,:,:)
+integer, allocatable :: isixd1(:,:,:,:,:,:)
+integer, allocatable :: isevend1(:,:,:,:,:,:,:)
+
+logical, save :: module_initialized = .false.
+
+! arg parsing code
+character(len=256) :: argline
+integer :: argcount = 1
+character(len=NF90_MAX_NAME) :: argwords(3)
+
+character(len=NF90_MAX_NAME) :: infile1
+character(len=NF90_MAX_NAME) :: nextfield
+logical :: from_file
+
+character(len=512) :: string1, string2, string3
+
+integer :: iunit, io
+
+interface process
+ procedure process_int_1d
+ procedure process_int_2d
+ procedure process_int_3d
+ procedure process_r4_1d
+ procedure process_r4_2d
+ procedure process_r4_3d
+end interface
+
+logical :: debug = .false. ! or .true.
+logical :: fail_on_missing_field = .true. ! or .false.
+logical :: do_all_numeric_fields = .true. ! or .false.
+logical :: only_report_differences = .true. ! or .false.
+character(len=NF90_MAX_NAME) :: fieldnames(1000) = '' ! something large
+character(len=256) :: fieldlist_file = ''
+
+! fieldnames here?
+namelist /forcing_check_nml/ debug, fail_on_missing_field, &
+ do_all_numeric_fields, &
More information about the Dart-dev
mailing list