[Dart-dev] [3254] DART/trunk/models/MITgcm_ocean/model_mod.f90: one more minor update.

nancy at subversion.ucar.edu nancy at subversion.ucar.edu
Thu Mar 13 15:01:39 MDT 2008


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20080313/51cdb764/attachment.html
-------------- next part --------------
Modified: DART/trunk/models/MITgcm_ocean/model_mod.f90
===================================================================
--- DART/trunk/models/MITgcm_ocean/model_mod.f90	2008-03-13 20:30:44 UTC (rev 3253)
+++ DART/trunk/models/MITgcm_ocean/model_mod.f90	2008-03-13 21:01:38 UTC (rev 3254)
@@ -17,7 +17,8 @@
 use        types_mod, only : r8
 use time_manager_mod, only : time_type, set_time
 use     location_mod, only : location_type,      get_close_maxdist_init, &
-                             get_close_obs_init, get_close_obs, set_location
+                             get_close_obs_init, get_close_obs, set_location, &
+                             VERTISHEIGHT
 use    utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, &
                              logfileunit, &
                              find_namelist_in_file, check_namelist_read
@@ -243,6 +244,26 @@
 
 integer :: iunit, io
 
+! The Plan:
+!
+!   read the standard MITgcm namelist file 'data' for the
+!   file info, the time step size, and maybe some grid info
+!   (e.g. projection type)
+!
+!   open the individual files, one at a time, and read in
+!   the meta files for the array sizes.  add them up as you go
+!   to compute the total model size
+!
+!   open the grid data files to get the actual grid coordinates
+!
+!   open the S,T,U,V,SSH files to read in the data values
+!   into the state vector
+!
+!   set the index numbers where the field types change
+!
+!   set the grid location info
+!
+
 ! Print module information to log file and stdout.
 call register_module(source, revision, revdate)
 
@@ -261,6 +282,7 @@
 read(iunit, nml = PARM03, iostat = io)
 call check_namelist_read(iunit, io, "PARM03")
 
+! depths are going to be in this namelist
 call find_namelist_in_file("data", "PARM04", iunit)
 read(iunit, nml = PARM04, iostat = io)
 call check_namelist_read(iunit, io, "PARM04")
@@ -269,37 +291,28 @@
 read(iunit, nml = PARM05, iostat = io)
 call check_namelist_read(iunit, io, "PARM05")
 
+! for reading/writing the restart files, tim is writing
+! some utility routines which will look like this:
+!
+! call read_snapshot('XC', array(:,:), data_time)
+! call read_snapshot('XG', array(:,:), data_time)
+! call read_snapshot('YC', array(:,:), data_time)
+! call read_snapshot('YG', array(:,:), data_time)
+! 
+! we pass in a filename (without the .meta and the .data)
+! and an unallocated array of the right dimensionality.
+! it returns the allocated, filled array, along with the timestamp.
 
+! when we are done, drop_snapshot() frees the space for symmetry
 
-! The Plan:
-!
-!   read the standard MITgcm namelist file 'data' for the
-!   file info, the time step size, and maybe some grid info
-!   (e.g. projection type)
-!
-!   open the individual files, one at a time, and read in
-!   the meta files for the array sizes.  add them up as you go
-!   to compute the total model size
-!
-!   open the grid data files to get the actual grid coordinates
-!
-!   open the S,T,U,V,SSH files to read in the data values
-!   into the state vector
-!
-!   set the index numbers where the field types change
-!
-!   set the grid location info
-!
 
-! for now, here's an example:
-! the data files are all 256 x 225 for simplicity, but with
-! the staggering, the actual counts of valid data values are:
-!  S,T = 255 x 224 x 70
-!  U   = 256 x 224 x 70
-!  V   = 255 x 225 x 70
-!  SSH = 255 x 224
+! for now, here's a hard-coded example to get this compiling:
+! in spite of the staggering, all grids are the same size
+! and offset by half a grid cell.  4 are 3D and 1 is 2D.
+!  S,T,U,V = 256 x 225 x 70
+!  SSH = 256 x 225
 
-model_size = 255*224*70 + 255*224*70 + 256*224*70 + 225*225*70 + 255*224
+model_size = 4 * (256*225*70) + (256*225)
 
 ! Create storage for locations
 allocate(state_vector(model_size))
@@ -410,6 +423,8 @@
 real(r8),           intent(out) :: obs_val
 integer,            intent(out) :: istatus
 
+! FIXME: we need to put interp code here.
+
 ! Default for successful return
 istatus = 0
 
@@ -448,7 +463,7 @@
 
 if (index_in < start_index(S_index+1)) then
    var_type = KIND_SALINITY  
-   !location = 
+   !location = set_location(lon, lat, depth, VERTISHEIGHT)
 else if (index_in < start_index(T_index+1)) then
    var_type = KIND_TEMPERATURE  
    !location =


More information about the Dart-dev mailing list