[Dart-dev] DART/branches Revision: 11103

dart at ucar.edu dart at ucar.edu
Mon Feb 13 12:01:17 MST 2017


hendric at ucar.edu
2017-02-13 12:01:17 -0700 (Mon, 13 Feb 2017)
45
updating model to work with single file IO.




Modified: DART/branches/rma_single_file/models/lorenz_04/model_mod.f90
===================================================================
--- DART/branches/rma_single_file/models/lorenz_04/model_mod.f90	2017-02-13 18:47:18 UTC (rev 11102)
+++ DART/branches/rma_single_file/models/lorenz_04/model_mod.f90	2017-02-13 19:01:17 UTC (rev 11103)
@@ -591,8 +591,7 @@
 ! netCDF variables for Location
 !--------------------------------------------------------------------
 
-integer :: LocationVarID
-integer :: StateVarDimID, StateVarVarID
+integer :: LocationDimID, LocationVarID
 integer :: StateVarID, MemberDimID, TimeDimID
 
 !--------------------------------------------------------------------
@@ -608,7 +607,7 @@
 integer  :: i
 real(r8) :: lctn
 
-model_will_write_state = .true.
+model_will_write_state = .false.
 ierr = 0                      ! assume normal termination
 
 !--------------------------------------------------------------------
@@ -620,15 +619,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
 !--------------------------------------------------------------------
 call DATE_AND_TIME(crdate,crtime,crzone,values)
@@ -658,8 +648,8 @@
 ! Define the model size, state variable dimension ... whatever ...
 !--------------------------------------------------------------------
 
-call check(nf90_def_dim(ncid=ncFileID, name="StateVariable", &
-                        len=int(model_size, i4), dimid = StateVarDimID))
+call check(nf90_def_dim(ncid=ncFileID, name="location", &
+                        len=int(model_size, i4), dimid = LocationDimID))
 
 !--------------------------------------------------------------------
 ! Define the Location Variable and add Attributes
@@ -668,8 +658,8 @@
 ! 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"))
@@ -676,26 +666,11 @@
 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, int(model_size, i4) /)))
-
-! 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) /) ))
+call check(nf90_put_var(ncFileID, LocationVarID, (/ (i,i=1,model_size) /) ))
 
 !--------------------------------------------------------------------
 ! Fill the location variable
@@ -767,36 +742,8 @@
 integer :: nDimensions, nVariables, nAttributes, unlimitedDimID
 integer :: StateVarID
 
-!-------------------------------------------------------------------------------
-! local variables
-!-------------------------------------------------------------------------------
-
 ierr = 0                      ! assume normal termination
 
-!-------------------------------------------------------------------------------
-! make sure ncFileID refers to an open netCDF file


More information about the Dart-dev mailing list