[Dart-dev] DART/branches Revision: 11594

dart at ucar.edu dart at ucar.edu
Wed May 3 16:36:46 MDT 2017


hendric at ucar.edu
2017-05-03 16:36:46 -0600 (Wed, 03 May 2017)
71
fixing up wrf to write out grid information using
domain information.




Modified: DART/branches/model_mod_changes/models/wrf/model_mod.f90
===================================================================
--- DART/branches/model_mod_changes/models/wrf/model_mod.f90	2017-05-03 17:29:35 UTC (rev 11593)
+++ DART/branches/model_mod_changes/models/wrf/model_mod.f90	2017-05-03 22:36:46 UTC (rev 11594)
@@ -53,11 +53,14 @@
 
 use     utilities_mod,  only  : file_exist, open_file, close_file, &
                                 register_module, error_handler, E_ERR, E_WARN, &
-                                E_MSG, nmlfileunit, do_output, nc_check, &
+                                E_MSG, nmlfileunit, do_output, &
                                 find_namelist_in_file, check_namelist_read, &
                                 find_textfile_dims, file_to_text, &
                                 do_nml_file, do_nml_term, scalar
 
+use netcdf_utilities_mod, only : nc_add_global_attribute, nc_check, nc_sync, &
+                                 nc_add_global_creation_time, nc_redef, nc_enddef
+
 use  mpi_utilities_mod,  only : my_task_id, task_count
 
 use     random_seq_mod,  only : random_seq_type, init_random_seq, random_gaussian
@@ -263,7 +266,6 @@
 logical :: use_geopotential_height = .false.
 
 character(len = 20) :: wrf_nml_file = 'namelist.input'
-logical :: have_wrf_nml_file = .false.
 integer :: num_obs_kinds = 0
 logical, allocatable :: in_state_vector(:)
 integer, allocatable  :: domain_id(:) ! Global storage to interface with state_structure_mod.
@@ -3652,17 +3654,16 @@
 !***********************************************************************
 
 
-subroutine nc_write_model_atts( ncFileID, domain_id ) 
+subroutine nc_write_model_atts( ncid, dom_id ) 
 !-----------------------------------------------------------------
 ! Writes the model-specific attributes to a netCDF file
 
-integer, intent(in) :: ncFileID      ! netCDF file identifier
-integer, intent(in) :: domain_id
+integer, intent(in) :: ncid      ! netCDF file identifier
+integer, intent(in) :: dom_id
 
 logical, parameter :: write_precip = .false.
 
 integer :: nDimensions, nVariables, nAttributes, unlimitedDimID
-integer :: StateVarDimID, StateVarID, TimeDimID
 
 integer, dimension(num_domains) :: weDimID, weStagDimID, snDimID, snStagDimID, &
      btDimID, btStagDimID, slSDimID, tmp
@@ -3671,7 +3672,6 @@
 integer :: DXVarID, DYVarID, TRUELAT1VarID, TRUELAT2VarID, STAND_LONVarID
 integer :: CEN_LATVarID, CEN_LONVarID, MAP_PROJVarID
 integer :: PERIODIC_XVarID, POLARVarID
-integer :: metadataID, wrfStateID, wrfDimID, WRFStateVarID, WRFStateDimID
 
 integer, dimension(num_domains) :: DNVarID, ZNUVarID, DNWVarID, phbVarID, &
      MubVarID, LonVarID, LatVarID, ilevVarID, XlandVarID, hgtVarID , LatuVarID, &
@@ -3687,127 +3687,71 @@
 
 character(len=129) :: title
 
-character(len=8)      :: crdate      ! needed by F90 DATE_AND_TIME intrinsic
-character(len=10)     :: crtime      ! needed by F90 DATE_AND_TIME intrinsic
-character(len=5)      :: crzone      ! needed by F90 DATE_AND_TIME intrinsic
-integer, dimension(8) :: values      ! needed by F90 DATE_AND_TIME intrinsic
-character(len=NF90_MAX_NAME) :: str1
-
 character (len=1)     :: idom
 
 character(len=129), allocatable, dimension(:) :: textblock
-integer :: nlines, linelen
-integer :: linelenDimID, nlinesDimID, nmlVarID
 integer :: ind, my_index
 character(len=NF90_MAX_NAME) :: attname, varname
 character(len=129) :: unitsval, descriptionval, coordinatesval, long_nameval, coordinate_char
-integer, dimension(5) :: dimids_3D
-integer, dimension(4) :: dimids_2D
 logical               :: debug = .false.
-
+character(len=256) :: filename
 !-----------------------------------------------------------------
 
 !-----------------------------------------------------------------
-! make sure ncFileID refers to an open netCDF file, 
+! make sure ncid refers to an open netCDF file, 
 ! and then put into define mode.
 !-----------------------------------------------------------------
+call nc_check(nf90_Inquire(ncid, nDimensions, nVariables, nAttributes, unlimitedDimID), &
+              'nc_write_model_vars','inquire')
 
-call nc_check(nf90_get_att(ncFileID, NF90_GLOBAL, 'title', title), 'nc_write_model_atts','get_att')
-call nc_check(nf90_Inquire(ncFileID, nDimensions, nVariables, nAttributes, unlimitedDimID), &
-              'nc_write_model_atts','inquire')
-call nc_check(nf90_Redef(ncFileID),'nc_write_model_atts','redef')
+write(filename,*) 'ncid', ncid
 
-!-----------------------------------------------------------------
-! We need the dimension ID for the number of copies 
-!-----------------------------------------------------------------
-
-call nc_check(nf90_inq_dimid(ncid=ncFileID, name="NMLlinelen", dimid=linelenDimID), &


More information about the Dart-dev mailing list