[Dart-dev] DART/branches Revision: 11529
dart at ucar.edu
dart at ucar.edu
Wed Apr 26 17:04:54 MDT 2017
hendric at ucar.edu
2017-04-26 17:04:54 -0600 (Wed, 26 Apr 2017)
56
not writing prognostic variables, just grid variables.
Modified: DART/branches/rma_output_files/models/mpas_atm/model_mod.f90
===================================================================
--- DART/branches/rma_output_files/models/mpas_atm/model_mod.f90 2017-04-26 22:45:30 UTC (rev 11528)
+++ DART/branches/rma_output_files/models/mpas_atm/model_mod.f90 2017-04-26 23:04:54 UTC (rev 11529)
@@ -198,7 +198,6 @@
real(r8) :: model_perturbation_amplitude = 0.0001 ! tiny amounts
real(r8) :: highest_obs_pressure_mb = 100.0_r8 ! do not assimilate obs higher than this level.
real(r8) :: sfc_elev_max_diff = -1.0_r8 ! do not assimilate if |model - station| height is larger than this [m].
-logical :: output_state_vector = .false. ! output prognostic variables (if .false.)
logical :: log_p_vert_interp = .true. ! if true, interpolate vertical pressure in log space
integer :: debug = 0 ! turn up for more and more debug messages
integer :: xyzdebug = 0
@@ -1282,10 +1281,6 @@
integer :: StateVarID ! netCDF pointer to 3D [state,copy,time] array
-!----------------------------------------------------------------------
-! variables if we parse the state vector into prognostic variables.
-!----------------------------------------------------------------------
-
! for the dimensions and coordinate variables
integer :: nCellsDimID
integer :: nEdgesDimID, maxEdgesDimID
@@ -1322,7 +1317,7 @@
if ( .not. module_initialized ) call static_init_model
ierr = -1 ! assume things go poorly
-model_mod_writes_state_variables = .true.
+model_mod_writes_state_variables = .false.
!--------------------------------------------------------------------
! we only have a netcdf handle here so we do not know the filename
@@ -1348,25 +1343,7 @@
! Our job is create the 'model size' dimension.
!-------------------------------------------------------------------------------
-call nc_check(nf90_inq_dimid(ncid=ncFileID, name='copy', dimid=MemberDimID), &
- 'nc_write_model_atts', 'copy dimid '//trim(filename))
-call nc_check(nf90_inq_dimid(ncid=ncFileID, name='time', dimid= TimeDimID), &
- 'nc_write_model_atts', 'time dimid '//trim(filename))
-
-if ( TimeDimID /= unlimitedDimId ) then
- write(string1,*)'Time Dimension ID ',TimeDimID, &
- ' should equal Unlimited Dimension ID',unlimitedDimID
- call error_handler(E_ERR,'nc_write_model_atts', string1, source, revision, revdate)
-endif
-
!-------------------------------------------------------------------------------
-! Define the model size / state variable dimension / whatever ...
-!-------------------------------------------------------------------------------
-
-call nc_check(nf90_def_dim(ncid=ncFileID, name='StateVariable', len=model_size, &
- dimid = StateVarDimID),'nc_write_model_atts', 'state def_dim '//trim(filename))
-
-!-------------------------------------------------------------------------------
! Write Global Attributes
!-------------------------------------------------------------------------------
@@ -1385,336 +1362,278 @@
call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, 'model', 'MPAS_ATM' ), &
'nc_write_model_atts', 'model put '//trim(filename))
-!-------------------------------------------------------------------------------
-! Here is the extensible part. The simplest scenario is to output the state vector,
-! parsing the state vector into model-specific parts is complicated, and you need
-! to know the geometry, the output variables (PS,U,V,T,Q,...) etc. We're skipping
-! complicated part.
-!-------------------------------------------------------------------------------
-if ( output_state_vector ) then
+!----------------------------------------------------------------------------
+! Define the new dimensions IDs
+!----------------------------------------------------------------------------
- !----------------------------------------------------------------------------
- ! Create a variable for the state vector
- !----------------------------------------------------------------------------
+call nc_check(nf90_def_dim(ncid=ncFileID, name='nCells', &
+ len = nCells, dimid = nCellsDimID),'nc_write_model_atts', 'nCells def_dim '//trim(filename))
- ! Define the actual (3D) state vector, which gets filled as time goes on ...
- call nc_check(nf90_def_var(ncid=ncFileID, name='state', xtype=nf90_real, &
- dimids=(/StateVarDimID,MemberDimID,unlimitedDimID/),varid=StateVarID),&
- 'nc_write_model_atts','state def_var '//trim(filename))
- call nc_check(nf90_put_att(ncFileID,StateVarID,'long_name','model state or fcopy'),&
- 'nc_write_model_atts', 'state long_name '//trim(filename))
+call nc_check(nf90_def_dim(ncid=ncFileID, name='nEdges', &
+ len = nEdges, dimid = nEdgesDimID),'nc_write_model_atts', 'nEdges def_dim '//trim(filename))
- ! Leave define mode.
- call nc_check(nf90_enddef(ncFileID),'nc_write_model_atts','state enddef '//trim(filename))
+call nc_check(nf90_def_dim(ncid=ncFileID, name='nVertLevels', &
+ len = nVertLevels, dimid = NVertLevelsDimID),'nc_write_model_atts', &
+ 'nVertLevels def_dim '//trim(filename))
-else
+call nc_check(nf90_def_dim(ncid=ncFileID, name='nVertLevelsP1', &
+ len = nVertLevelsP1, dimid = NVertLevelsP1DimID),'nc_write_model_atts', &
+ 'nVertLevelsP1 def_dim '//trim(filename))
+call nc_check(nf90_def_dim(ncid=ncFileID, name='nSoilLevels', &
More information about the Dart-dev
mailing list