[Dart-dev] DART/branches Revision: 11067

dart at ucar.edu dart at ucar.edu
Wed Feb 8 17:08:44 MST 2017


hendric at ucar.edu
2017-02-08 17:08:44 -0700 (Wed, 08 Feb 2017)
46
Updating Lorenz_84 namelists and attributes.




Modified: DART/branches/rma_single_file/models/lorenz_84/model_mod.f90
===================================================================
--- DART/branches/rma_single_file/models/lorenz_84/model_mod.f90	2017-02-08 23:41:14 UTC (rev 11066)
+++ DART/branches/rma_single_file/models/lorenz_84/model_mod.f90	2017-02-09 00:08:44 UTC (rev 11067)
@@ -361,9 +361,7 @@
 ! netCDF variables for Location
 !--------------------------------------------------------------------
 
-integer :: LocationVarID
-integer :: StateVarDimID, StateVarVarID
-integer :: StateVarID, MemberDimID, TimeDimID
+integer :: LocationVarID, LocationDimID
 
 !--------------------------------------------------------------------
 ! local variables
@@ -379,7 +377,7 @@
 type(location_type) :: lctn 
 ierr = 0                      ! assume normal termination
 
-model_mod_writes_state_variables = .true.
+model_mod_writes_state_variables = .false.
 
 !--------------------------------------------------------------------
 ! make sure ncFileID refers to an open netCDF file 
@@ -390,15 +388,6 @@
 call check(nf90_Redef(ncFileID))
 
 !--------------------------------------------------------------------
-! Determine ID's from stuff already in the netCDF file
-!--------------------------------------------------------------------
-
-! make sure time is unlimited dimid
-
-call check(nf90_inq_dimid(ncFileID,"copy",dimid=MemberDimID))
-call check(nf90_inq_dimid(ncFileID,"time",dimid=TimeDimID))
-
-!--------------------------------------------------------------------
 ! Write Global Attributes 
 !--------------------------------------------------------------------
 
@@ -421,8 +410,9 @@
 ! Define the model size, state variable dimension ... whatever ...
 !--------------------------------------------------------------------
 
-call check(nf90_def_dim(ncid=ncFileID, name="StateVariable", &
-                        len=model_size, dimid = StateVarDimID)) 
+call nc_check(nf90_def_dim(ncid=ncFileID, name="location", &
+                           len=int(model_size, i4), dimid = LocationDimID), &
+                          'nc_write_model_atts', 'def_dim location')
 
 !--------------------------------------------------------------------
 ! Define the Location Variable and add Attributes
@@ -431,35 +421,16 @@
 ! http://www.cgd.ucar.edu/cms/eaton/netcdf/CF-working.html#ctype
 !--------------------------------------------------------------------
 
-call check(NF90_def_var(ncFileID, name=trim(adjustl(LocationName)), xtype=nf90_double, &
-              dimids = StateVarDimID, varid=LocationVarID) )
+call check(NF90_def_var(ncFileID, name="location", xtype=nf90_double, &
+              dimids = LocationDimID, varid=LocationVarID) )
 call check(nf90_put_att(ncFileID, LocationVarID, "long_name", trim(adjustl(LocationLName))))
 call check(nf90_put_att(ncFileID, LocationVarID, "dimension", LocationDims ))
 call check(nf90_put_att(ncFileID, LocationVarID, "units", "nondimensional"))
 call check(nf90_put_att(ncFileID, LocationVarID, "valid_range", (/ 0.0_r8, 1.0_r8 /)))
 
-!--------------------------------------------------------------------
-! Define either the "state vector" variables -OR- the "prognostic" variables.
-!--------------------------------------------------------------------
-
-! Define the state vector coordinate variable
-call check(nf90_def_var(ncid=ncFileID,name="StateVariable", xtype=nf90_int, &
-           dimids=StateVarDimID, varid=StateVarVarID))
-call check(nf90_put_att(ncFileID, StateVarVarID, "long_name", "State Variable ID"))
-call check(nf90_put_att(ncFileID, StateVarVarID, "units",     "indexical") )
-call check(nf90_put_att(ncFileID, StateVarVarID, "valid_range", (/ 1, model_size /)))
-
-! Define the actual state vector
-call check(nf90_def_var(ncid=ncFileID, name="state", xtype=nf90_double, &
-           dimids = (/ StateVarDimID, MemberDimID, TimeDimID /), varid=StateVarID))
-call check(nf90_put_att(ncFileID, StateVarID, "long_name", "model state or fcopy"))
-
 ! Leave define mode so we can fill
 call check(nf90_enddef(ncfileID))
 
-! Fill the state variable coordinate variable
-call check(nf90_put_var(ncFileID, StateVarVarID, (/ (i,i=1,model_size) /) ))
-
 !--------------------------------------------------------------------
 ! Fill the location variable
 !--------------------------------------------------------------------
@@ -498,44 +469,8 @@
 integer,                intent(in) :: timeindex
 integer                            :: ierr          ! return value of function
 
-
-!--------------------------------------------------------------------
-! General netCDF variables
-!--------------------------------------------------------------------
-
-integer :: nDimensions, nVariables, nAttributes, unlimitedDimID
-integer :: StateVarID


More information about the Dart-dev mailing list