[Dart-dev] [5933] DART/branches/development/models/mpas_ocn/model_mod.f90: Removed dependence on the existence of nVertLevelsP1 dimension.

nancy at ucar.edu nancy at ucar.edu
Mon Dec 3 15:19:31 MST 2012


Revision: 5933
Author:   thoar
Date:     2012-12-03 15:19:30 -0700 (Mon, 03 Dec 2012)
Log Message:
-----------
Removed dependence on the existence of nVertLevelsP1 dimension.
The atmosphere has one, the ocean does not. The ocean restart file
now has a zMid variable to define the depth of the midpoint of the layers.

Using zMid for all vertical information and the conversion from potential
to sensible(in-situ) temperatures still must be implemented.

Modified Paths:
--------------
    DART/branches/development/models/mpas_ocn/model_mod.f90

-------------- next part --------------
Modified: DART/branches/development/models/mpas_ocn/model_mod.f90
===================================================================
--- DART/branches/development/models/mpas_ocn/model_mod.f90	2012-11-30 23:43:30 UTC (rev 5932)
+++ DART/branches/development/models/mpas_ocn/model_mod.f90	2012-12-03 22:19:30 UTC (rev 5933)
@@ -396,7 +396,6 @@
 
 ! Local variables - all the important ones have module scope
 
-
 integer, dimension(NF90_MAX_VAR_DIMS) :: dimIDs
 character(len=NF90_MAX_NAME)          :: varname,dimname
 character(len=paramname_length)       :: kind_string
@@ -2654,11 +2653,11 @@
 read( s ,'(i4,5(1x,i2))') iyear, imonth, iday, ihour, imin, isec
 
 if (iyear < 1601) then
-   write(string1,*)'WARNING: Converting YEAR ',iyear,' to ',iyear+1600
+   write(string1,*)'WARNING: Converting YEAR ',iyear,' to ',iyear+1601
    write(string2,*)'original time (string) is <',trim(s),'>'
    call error_handler(E_MSG, 'string_to_time', string1, &
                source, revision, revdate, text2=string2)
-   iyear = iyear + 1600
+   iyear = iyear + 1601
 endif
 
 string_to_time = set_date(iyear, imonth, iday, ihour, imin, isec)
@@ -2736,11 +2735,16 @@
             'read_grid_dims','inquire_dimension nVertLevels '//trim(grid_definition_filename))
 
 ! nVertLevelsP1 : get dimid for 'nVertLevelsP1' and then get value
+! This exists in the atmosphere, but not in the ocean - at this point.
+! In the hopes we can consolidate this function to be useful in both instances,
+! I am extending this to work in both scenarios.
 
-call nc_check(nf90_inq_dimid(grid_id, 'nVertLevelsP1', dimid), &
-              'read_grid_dims','inq_dimid nVertLevelsP1 '//trim(grid_definition_filename))
-call nc_check(nf90_inquire_dimension(grid_id, dimid, len=nVertLevelsP1), &
-            'read_grid_dims','inquire_dimension nVertLevelsP1 '//trim(grid_definition_filename))
+if( nf90_inq_dimid(grid_id, 'nVertLevelsP1', dimid) == NF90_NOERR ) then
+   call nc_check(nf90_inquire_dimension(grid_id, dimid, len=nVertLevelsP1), &
+         'read_grid_dims','inquire_dimension nVertLevelsP1 '//trim(grid_definition_filename))
+else
+   nVertLevelsP1 = nVertLevels + 1
+endif
 
 ! vertexDegree : get dimid for 'vertexDegree' and then get value
 


More information about the Dart-dev mailing list