[Dart-dev] [4025] DART/trunk/models/POP: A non-advancing 'perfect model' assimilation and 'filter' worked for a

nancy at ucar.edu nancy at ucar.edu
Mon Aug 31 15:25:29 MDT 2009


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090831/27d0d990/attachment.html 
-------------- next part --------------
Modified: DART/trunk/models/POP/dart_pop_mod.f90
===================================================================
--- DART/trunk/models/POP/dart_pop_mod.f90	2009-08-28 22:46:16 UTC (rev 4024)
+++ DART/trunk/models/POP/dart_pop_mod.f90	2009-08-31 21:25:29 UTC (rev 4025)
@@ -66,6 +66,17 @@
     stop_option, stop_count, date_separator, allow_leapyear, fit_freq
 
 !------------------------------------------------------------------
+! The POP I/O namelist variables
+!------------------------------------------------------------------
+
+character(len=100) :: log_filename, pointer_filename
+logical :: lredirect_stdout, luse_pointer_files
+integer :: num_iotasks
+
+namelist /io_nml/ num_iotasks, lredirect_stdout, log_filename, &
+    luse_pointer_files, pointer_filename
+
+!------------------------------------------------------------------
 ! The POP restart manager namelist variables
 !------------------------------------------------------------------
 
@@ -168,25 +179,46 @@
    call set_calendar_type('noleap')
 endif
 
+! Read POP I/O information (for restart file ... grid dimensions)
 ! Read POP initial information (for input/restart filename)
-! The tricky part here is that we should really check for
-! the existence of the init_ts_file and take evasive action
-! like checking for the existence of a pointer file.
 
+call find_namelist_in_file('pop_in', 'io_nml', iunit)
+read(iunit, nml = io_nml, iostat = io)
+call check_namelist_read(iunit, io, 'io_nml')
+
 call find_namelist_in_file('pop_in', 'init_ts_nml', iunit)
 read(iunit, nml = init_ts_nml, iostat = io)
 call check_namelist_read(iunit, io, 'init_ts_nml')
 
-ic_filename = trim(init_ts_file)//'.'//trim(init_ts_file_fmt)
+! Is it a pointer file or not ...
+if ( luse_pointer_files ) then
 
-! FIXME ... what about the pointer file ...
+   restart_filename = trim(pointer_filename)//'.restart'
+
+   if ( .not. file_exist(restart_filename) ) then
+      msgstring = 'pop_in:pointer file '//trim(restart_filename)//' not found'
+      call error_handler(E_ERR,'initialize_module', &
+             msgstring, source, revision, revdate)
+   endif
+
+   iunit = open_file(restart_filename,'formatted')
+   read(iunit,'(A)')ic_filename
+
+   restart_filename = ' '  
+   write(*,*)'DEBUG ... pointer filename dereferenced to ',trim(ic_filename )
+
+else
+   ic_filename = trim(init_ts_file)//'.'//trim(init_ts_file_fmt)
+endif
+
+! Make sure we have a pop restart file (for grid dims)
 if ( .not. file_exist(ic_filename) ) then
    msgstring = 'pop_in:init_ts_file '//trim(ic_filename)//' not found'
    call error_handler(E_ERR,'initialize_module', &
           msgstring, source, revision, revdate)
 endif
 
-! Read POP restart information (for model timestepping/grid dimensions)
+! Read POP restart information (for model timestepping)
 call find_namelist_in_file('pop_in', 'restart_nml', iunit)
 read(iunit, nml = restart_nml, iostat = io)
 call check_namelist_read(iunit, io, 'restart_nml')
@@ -196,7 +228,7 @@
 read(iunit, nml = domain_nml, iostat = io)
 call check_namelist_read(iunit, io, 'domain_nml')
 
-! Read POP grid information (for grid dims/filenames)
+! Read POP grid information (for grid filenames)
 call find_namelist_in_file('pop_in', 'grid_nml', iunit)
 read(iunit, nml = grid_nml, iostat = io)
 call check_namelist_read(iunit, io, 'grid_nml')

Modified: DART/trunk/models/POP/dart_to_pop.f90
===================================================================
--- DART/trunk/models/POP/dart_to_pop.f90	2009-08-28 22:46:16 UTC (rev 4024)
+++ DART/trunk/models/POP/dart_to_pop.f90	2009-08-31 21:25:29 UTC (rev 4025)
@@ -47,7 +47,7 @@
 ! The namelist variables
 !------------------------------------------------------------------
 
-character (len = 128) :: dart_to_pop_input_file   = 'assim_model_state_ic'
+character (len = 128) :: dart_to_pop_input_file   = 'filter_ics'
 character (len = 128) :: dart_to_pop_restart_file = 'my_pop_restart_file'
 logical               :: advance_time_present     = .TRUE.
 

Added: DART/trunk/models/POP/shell_scripts/run_perfect_model_obs.batch
===================================================================
--- DART/trunk/models/POP/shell_scripts/run_perfect_model_obs.batch	                        (rev 0)
+++ DART/trunk/models/POP/shell_scripts/run_perfect_model_obs.batch	2009-08-31 21:25:29 UTC (rev 4025)
@@ -0,0 +1,223 @@
+#!/bin/csh
+#
+#BXXX -b 18:00
+#BSUB -J POP_OSSE
+#BSUB -o POP_OSSE.%J.log
+#BSUB -N -u ${USER}@ucar.edu
+#BSUB -q economy
+#BSUB -n 16
+#BSUB -R "span[ptile=2]"
+#BSUB -W 2:00
+#BSUB -m  "cr0128en cr0129en cr0130en cr0131en cr0132en cr0133en cr0134en cr0135en cr0136en cr0137en cr0138en cr0139en cr0140en cr0141en cr0202en cr0201en"
+#
+#-----------------------------------------------------------------------------
+# Data Assimilation Research Testbed -- DART
+# Copyright 2004-2009, Data Assimilation Research Section
+# University Corporation for Atmospheric Research
+# Licensed under the GPL -- www.gpl.org/licenses/gpl.html
+#
+# <next few lines under version control, do not edit>
+# $URL: http://subversion.ucar.edu/DAReS/DART/trunk/models/POP/shell_scripts/job.simple.csh $
+# $Id: job.simple.csh 3575 2008-08-21 18:01:05Z thoar $
+# $Revision: 3575 $
+# $Date: 2008-08-21 12:01:05 -0600 (Thu, 21 Aug 2008) $
+#-----------------------------------------------------------------------------
+# run_perfect_model_obs.batch ... Top level script to generate observations and a TRUE state.
+#
+# Unlike the more complex job.csh, this script only processes a single 
+# observation file.  Still fairly complex; requires a raft of
+# data files and most of them are in hardcoded locations.
+#
+# This script is designed to be run from the command line (as a single thread)
+# and should only take a few seconds to a minute to complete, depending on
+# the filesystem performance and data file size.
+#
+# The script moves the necessary files to the current directory - in DART
+# nomenclature, this will be called CENTRALDIR. 
+# After everything is confirmed to have been assembled, it is possible
+# to edit the data, data.cal, and input.nml files for the specifics of 
+# the experiment; as well as allow final configuration of a 'nodelist' file.
+#
+# Once the 'table is set', all that remains is to start/submit the 
+# 'runme_filter' script. That script will spawn 'filter' as a 
+# parallel job on the appropriate nodes; each of these tasks will 
+# call a separate model_advance.csh when necessary.
+#
+# The central directory is where the scripts reside and where script and 
+# program I/O are expected to happen.
+#-----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------
+# Turns out the scripts are a lot more flexible if you don't rely on 
+# the queuing-system-specific variables -- so I am converting them to
+# 'generic' names and using the generics throughout the remainder.
+#----------------------------------------------------------------------
+
+if ($?LSB_HOSTS) then
+
+   setenv ORIGINALDIR $LS_SUBCWD
+   setenv JOBNAME     $LSB_OUTPUTFILE:ar
+   setenv JOBID       $LSB_JOBID
+   setenv MYQUEUE     $LSB_QUEUE
+   setenv MYHOST      $LSB_SUB_HOST
+
+else
+
+   #-------------------------------------------------------------------
+   # You can run this interactively to check syntax, file motion, etc.
+   #-------------------------------------------------------------------
+
+   setenv ORIGINALDIR `pwd`
+   setenv JOBNAME     POP
+   setenv JOBID       $$
+   setenv MYQUEUE     Interactive
+   setenv MYHOST      $host
+
+endif
+
+#----------------------------------------------------------------------
+# Just an echo of job attributes
+#----------------------------------------------------------------------
+
+echo
+echo "${JOBNAME} ($JOBID) submitted   from $ORIGINALDIR"
+echo "${JOBNAME} ($JOBID) submitted   from $MYHOST"
+echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE"
+echo "${JOBNAME} ($JOBID) running       on $host"
+echo "${JOBNAME} ($JOBID) started   at "`date`
+echo
+
+#----------------------------------------------------------------------
+# Make a unique, (empty, clean) temporary directory.
+#----------------------------------------------------------------------
+
+setenv TMPDIR /ptmp/${user}/${JOBNAME}/job_${JOBID}
+
+mkdir -p ${TMPDIR}
+cd ${TMPDIR}
+
+set CENTRALDIR = `pwd`
+set myname = $0          # this is the name of this script
+
+# some systems don't like the -v option to any of the following 
+
+set OSTYPE = `uname -s` 
+switch ( ${OSTYPE} )
+   case IRIX64:
+      setenv REMOVE 'rm -rf'
+      setenv   COPY 'cp -p'
+      setenv   MOVE 'mv -f'
+      breaksw
+   case AIX:
+      setenv REMOVE 'rm -rf'
+      setenv   COPY 'cp -p'
+      setenv   MOVE 'mv -f'
+      breaksw
+   default:
+      setenv REMOVE 'rm -rvf'
+      setenv   COPY 'cp -vp'
+      setenv   MOVE 'mv -fv'
+      breaksw
+endsw
+
+echo "${JOBNAME} ($JOBID) CENTRALDIR == $CENTRALDIR"
+
+#-----------------------------------------------------------------------------
+# Set variables containing various directory names where we will GET things
+#-----------------------------------------------------------------------------
+
+set DARTDIR = /fs/image/home/${user}/SVN/DART/models/POP
+set  POPDIR = /fs/image/home/${user}/SVN/DART/models/POP/input
+
+#-----------------------------------------------------------------------------
+# Get the DART executables, scripts, and input files
+#-----------------------------------------------------------------------------
+
+# executables
+${COPY} ${DARTDIR}/work/perfect_model_obs          .
+${COPY} ${DARTDIR}/work/dart_to_pop                .
+${COPY} ${DARTDIR}/work/pop_to_dart                .
+
+# shell scripts
+${COPY} ${DARTDIR}/shell_scripts/advance_model.csh .
+
+# data files
+${COPY} ${DARTDIR}/work/obs_seq.in                 .
+${COPY} ${DARTDIR}/work/dart.ics                   perfect_ics
+${COPY} ${DARTDIR}/work/input.nml                  .
+
+#-----------------------------------------------------------------------------
+# Get the POP executable, control files, and  data files.
+# trying to use the CCSM naming conventions
+#-----------------------------------------------------------------------------
+
+${COPY} ${POPDIR}/pop                       .
+${COPY} ${POPDIR}/pop_in.part1              .
+${COPY} ${POPDIR}/pop_in.part2              .
+${COPY} ${POPDIR}/pop.r.nc                  .
+echo "pop.r.nc" >! pop_pointer.restart
+
+${COPY} ${POPDIR}/gx3v5_tavg_contents       .
+${COPY} ${POPDIR}/gx3v5_movie_contents      .
+${COPY} ${POPDIR}/gx3v5_history_contents    .
+${COPY} ${POPDIR}/gx3v5_transport_contents  .
+
+${COPY} ${POPDIR}/vert_grid.gx3v5              .
+${COPY} ${POPDIR}/horiz_grid.gx3v5.r8ieee.le   .
+${COPY} ${POPDIR}/topography.gx3v5.r8ieee.le   .
+
+#${COPY} ${POPDIR}/chl_mm_SeaWiFs97-01_20031205.ieeer8   .
+#${COPY} ${POPDIR}/sfwf_20040517.ieeer8                  .
+#${COPY} ${POPDIR}/shf_20031208.ieeer8                   .
+#${COPY} ${POPDIR}/tidal_energy_gx3v5_20081021.ieeer8    .
+#${COPY} ${POPDIR}/ts_PHC2_jan_20030806.ieeer8           .
+
+#-----------------------------------------------------------------------------
+# Check that everything moved OK, and the table is set.
+# Gives us a chance to edit the local input.nml, data.cal, etc. if needed.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Run perfect_model_obs ... harvest the observations to populate obs_seq.out
+#-----------------------------------------------------------------------------
+
+cat pop_in.part1 pop_in.part2 >! pop_in
+
+./perfect_model_obs
+
+echo "${JOBNAME} ($JOBID) finished at "`date`
+
+#-----------------------------------------------------------------------------
+# Move the output to storage after filter completes.
+# At this point, all the restart,diagnostic files are in the CENTRALDIR
+# and need to be moved to the 'experiment permanent' directory.
+# We have had problems with some, but not all, files being moved
+# correctly, so we are adding bulletproofing to check to ensure the filesystem
+# has completed writing the files, etc. Sometimes we get here before
+# all the files have finished being written.
+#-----------------------------------------------------------------------------
+
+echo "Listing contents of CENTRALDIR before archiving"
+ls -l
+
+exit
+
+${MOVE} *.data *.meta         ${experiment}/POP
+${MOVE} data data.cal         ${experiment}/POP
+${MOVE} STD*                  ${experiment}/POP
+
+${MOVE} filter_restart*            ${experiment}/DART
+${MOVE} assim_model_state_ud[1-9]* ${experiment}/DART
+${MOVE} assim_model_state_ic[1-9]* ${experiment}/DART
+${MOVE} Posterior_Diag.nc          ${experiment}/DART
+${MOVE} Prior_Diag.nc              ${experiment}/DART
+${MOVE} obs_seq.final              ${experiment}/DART
+${MOVE} dart_log.out               ${experiment}/DART
+
+# Good style dictates that you save the scripts so you can see what worked.
+
+${COPY} input.nml                  ${experiment}/DART
+${COPY} *.csh                      ${experiment}/DART
+${COPY} $myname                    ${experiment}/DART
+
+ls -lrt


Property changes on: DART/trunk/models/POP/shell_scripts/run_perfect_model_obs.batch
___________________________________________________________________
Name: svn:executable
   + *

Added: DART/trunk/models/POP/work/README
===================================================================
--- DART/trunk/models/POP/work/README	                        (rev 0)
+++ DART/trunk/models/POP/work/README	2009-08-31 21:25:29 UTC (rev 4025)
@@ -0,0 +1,48 @@
+create_obs_sequence parameters:
+ Input upper bound on number of observations in sequence : 10
+ Input number of copies of data (0 for just a definition): 0
+ Input number of quality control values per field (0 or greater): 0
+ input a -1 if there are no more obs: 0
+
+      Input -1 * state variable index for identity observations
+      OR input the name of the observation kind from table below:
+      OR input the integer index, BUT see documentation...
+                 1 SALINITY
+                 2 TEMPERATURE
+                 3 U_CURRENT_COMPONENT
+                 4 V_CURRENT_COMPONENT
+                 5 SEA_SURFACE_HEIGHT
+2
+ location_mod:initialize_module  vert-normalization    20.0000000000000        100000.000000000        10000.0000000000
+ location_mod:initialize_module  horizontal only  T
+ Vertical co-ordinate options
+          -2  --> vertical coordinate undefined
+          -1  --> surface
+           1  --> model level
+           2  --> pressure
+           3  --> height
+3
+ Vertical co-ordinate height : 23.0
+ Input longitude: value 0 to 360.0 or a negative number for 
+ Uniformly distributed random location in the horizontal: 315
+ Input latitude: value -90.0 to 90.0: 30
+ input time in days and seconds (as integers):  8760 0
+ Input error variance for this observation definition : 2.0
+ input a -1 if there are no more obs : -1
+ Input filename for sequence (  set_def.out   usually works well): set_def.out
+
+#-------------------------------------------------------------------------------
+#-------------------------------------------------------------------------------
+
+create_fixed_network_sequence
+
+set_def.out
+1
+1
+8760 0
+1 0
+obs_seq.in
+
+
+
+

Modified: DART/trunk/models/POP/work/input.nml
===================================================================
--- DART/trunk/models/POP/work/input.nml	2009-08-28 22:46:16 UTC (rev 4024)
+++ DART/trunk/models/POP/work/input.nml	2009-08-31 21:25:29 UTC (rev 4025)
@@ -20,7 +20,7 @@
 &filter_nml
    async                    = 2,
    adv_ens_command          = "./advance_model.csh",
-   ens_size                 = 8,
+   ens_size                 = 10,
    start_from_restart       = .false.,
    output_restart           = .true.,
    obs_sequence_in_name     = "obs_seq.perfect",
@@ -78,7 +78,7 @@
 
 &ensemble_manager_nml
    single_restart_file_in  = .true.,
-   single_restart_file_out = .true.,
+   single_restart_file_out = .false.,
    perturbation_amplitude  = 0.2  /
 
 &cov_cutoff_nml


More information about the Dart-dev mailing list