[Dart-dev] [4304] DART/trunk/models/rose: Adding required targets.
nancy at ucar.edu
nancy at ucar.edu
Sun Mar 7 10:31:27 MST 2010
Revision: 4304
Author: thoar
Date: 2010-03-07 10:31:26 -0700 (Sun, 07 Mar 2010)
Log Message:
-----------
Adding required targets.
Reflects work by Tim & Tomoko to bring model up-to-date
and remove reliance on filter_server.csh scripting-type
parallelism. Renamed trans_sv_pv to dart_to_model,
renamed trans_pv_sv to model_to_dart. Easy.
Modified Paths:
--------------
DART/trunk/models/rose/shell_scripts/advance_model.csh
DART/trunk/models/rose/trans_perfect_ics.f90
DART/trunk/models/rose/trans_time.f90
DART/trunk/models/rose/work/path_names_filter
Added Paths:
-----------
DART/trunk/models/rose/dart_to_model.f90
DART/trunk/models/rose/model_to_dart.f90
DART/trunk/models/rose/shell_scripts/run_perfect_model_obs.csh
DART/trunk/models/rose/work/mkmf_dart_to_model
DART/trunk/models/rose/work/mkmf_model_to_dart
DART/trunk/models/rose/work/mkmf_nmlbld_rose
DART/trunk/models/rose/work/mkmf_trans_perfect_ics
DART/trunk/models/rose/work/mkmf_trans_time
DART/trunk/models/rose/work/path_names_dart_to_model
DART/trunk/models/rose/work/path_names_model_to_dart
DART/trunk/models/rose/work/path_names_nmlbld_rose
DART/trunk/models/rose/work/path_names_trans_perfect_ics
DART/trunk/models/rose/work/path_names_trans_time
Removed Paths:
-------------
DART/trunk/models/rose/trans_pv_sv.f90
DART/trunk/models/rose/trans_sv_pv.f90
DART/trunk/models/rose/work/mkmf_trans_pv_sv
DART/trunk/models/rose/work/mkmf_trans_sv_pv
DART/trunk/models/rose/work/path_names_trans_pv_sv
DART/trunk/models/rose/work/path_names_trans_sv_pv
-------------- next part --------------
Copied: DART/trunk/models/rose/dart_to_model.f90 (from rev 4301, DART/trunk/models/rose/trans_sv_pv.f90)
===================================================================
--- DART/trunk/models/rose/dart_to_model.f90 (rev 0)
+++ DART/trunk/models/rose/dart_to_model.f90 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,85 @@
+! DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+! provided by UCAR, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+
+program dart_to_model
+
+! <next few lines under version control, do not edit>
+! $URL$
+! $Id$
+! $Revision$
+! $Date$
+
+!----------------------------------------------------------------------
+! purpose: interface between ROSE and DART
+!
+! method: Read DART state vector ("proprietary" format)
+! Reform state vector back into ROSE fields.
+! Replace those fields on the ROSE restart file with the new values,
+! preserving all other information on the file.
+!
+! based on prog_var_to_vector and vector_to_prog_var for CAM
+!
+!----------------------------------------------------------------------
+
+use types_mod, only : r8
+use utilities_mod, only : get_unit, initialize_utilities
+use model_mod, only : model_type, init_model_instance, &
+ vector_to_prog_var, update_ROSE_restart
+use assim_model_mod, only : assim_model_type, static_init_assim_model, &
+ init_assim_model, get_model_size, get_model_state_vector, &
+ read_state_restart, open_restart_read, close_restart
+use time_manager_mod, only : time_type, read_time
+
+implicit none
+
+! version controlled file description for error handling, do not edit
+character(len=128), parameter :: &
+ source = "$URL$", &
+ revision = "$Revision$", &
+ revdate = "$Date$"
+
+type(assim_model_type) :: x
+type(model_type) :: var
+type(time_type) :: adv_to_time
+real(r8), allocatable :: x_state(:)
+integer :: file_unit, x_size
+character (len = 128) :: file_name = 'rose_restart.nc', file_in = 'temp_ic'
+
+call initialize_utilities(progname='dart_to_model', output_flag=.true.)
+
+! Static init assim model calls static_init_model
+PRINT*,'static_init_assim_model in dart_to_model'
+
+call static_init_assim_model()
+call init_assim_model(x)
+
+! Allocate the instance of the rose model type for storage
+call init_model_instance(var)
+
+file_unit = open_restart_read(file_in)
+PRINT*,'In dart_to_model file_in unit = ',file_unit
+PRINT*,' '
+
+! Read in time to which ROSE must advance.
+! Neither this, nor time in x (x%time) is used in this program
+! read in state vector from DART
+call read_state_restart(x, file_unit, adv_to_time)
+call close_restart(file_unit)
+
+! Get the state part of the assim_model type x
+x_size = get_model_size()
+allocate(x_state(x_size))
+PRINT*,'(dart_to_model) getting model state vector of length ',x_size
+x_state = get_model_state_vector(x)
+
+! decompose vector back into ROSE fields
+PRINT*,'(dart_to_model) converting vector to prog_var'
+call vector_to_prog_var (x_state, var)
+deallocate (x_state)
+
+! write fields to the binary ROSE restart file
+PRINT*,'(dart_to_model) updating ',trim(file_name)
+call update_ROSE_restart(file_name, var)
+
+end program dart_to_model
Copied: DART/trunk/models/rose/model_to_dart.f90 (from rev 4301, DART/trunk/models/rose/trans_pv_sv.f90)
===================================================================
--- DART/trunk/models/rose/model_to_dart.f90 (rev 0)
+++ DART/trunk/models/rose/model_to_dart.f90 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,87 @@
+! DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+! provided by UCAR, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+
+program model_to_dart
+
+! <next few lines under version control, do not edit>
+! $URL$
+! $Id$
+! $Revision$
+! $Date$
+
+!----------------------------------------------------------------------
+! purpose: interface between ROSE and DART
+!
+! method: Read ROSE restart file (binary format).
+! Reform fields into a state vector.
+! Write out state vector in "proprietary" format for DART
+!
+! based on model_to_dart for CAM
+!
+!----------------------------------------------------------------------
+
+use types_mod, only : r8
+use utilities_mod, only : get_unit, initialize_utilities
+use model_mod, only : model_type, init_model_instance, read_ROSE_restart, &
+ prog_var_to_vector
+use assim_model_mod, only : assim_model_type, static_init_assim_model, &
+ init_assim_model, get_model_size , &
+ set_model_state_vector, write_state_restart, &
+ set_model_time, open_restart_read, &
+ open_restart_write, close_restart, aread_state_restart
+use time_manager_mod, only : time_type
+
+implicit none
+
+! version controlled file description for error handling, do not edit
+character(len=128), parameter :: &
+ source = "$URL$", &
+ revision = "$Revision$", &
+ revdate = "$Date$"
+
+character (len = 128) :: &
+ file_name = 'rose_restart.nc', &
+ file_out = 'temp_ud'
+
+! Temporary allocatable storage to read in a native format for ROSE state
+type(assim_model_type) :: x
+type(model_type) :: var
+type(time_type) :: model_time
+real(r8), allocatable :: x_state(:)
+integer :: file_unit, x_size
+
+call initialize_utilities(progname='model_to_dart', output_flag=.true.)
+
+! Static init assim model calls static_init_model
+PRINT*,'static_init_assim_model in model_to_dart'
+call static_init_assim_model()
+
+! Initialize the assim_model instance
+call init_assim_model(x)
+
+! Allocate the local state vector
+x_size = get_model_size()
+allocate(x_state(x_size))
+
+! Allocate the instance of the ROSE model type for storage
+call init_model_instance(var)
+
+! Read the file ROSE state fragments into var
+call read_ROSE_restart(file_name, var, model_time)
+
+! transform fields into state vector for DART
+call prog_var_to_vector(var, x_state)
+
+call set_model_state_vector(x, x_state)
+
+call set_model_time(x, model_time)
+
+file_unit = open_restart_write(file_out)
+PRINT*,'In model_to_dart file_out unit = ',file_unit
+PRINT*,' '
+! write out state vector in "proprietary" format
+call write_state_restart(x, file_unit)
+call close_restart(file_unit)
+
+end program model_to_dart
Modified: DART/trunk/models/rose/shell_scripts/advance_model.csh
===================================================================
--- DART/trunk/models/rose/shell_scripts/advance_model.csh 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/shell_scripts/advance_model.csh 2010-03-07 17:31:26 UTC (rev 4304)
@@ -6,22 +6,28 @@
#
# $Id$
#
-# Standard script for use in assimilation applications
-# where the model advance is executed as a separate process.
-# Can be used with most low-order models and the bgrid model which
-# can be advanced using the integrate_model executable.
+# This script has 4 logical 'blocks':
+# 1) creates a clean, temporary directory in which to run a model instance
+# and copies the necessary files into the temporary directory
+# 2) converts the DART output to input expected by the model
+# 3) runs the model
+# 4) converts the model output to input expected by DART
#
-# This script copies the necessary files into the temporary directory
-# and then executes the fortran program integrate_model.
+# The error code from the script reflects which block it failed.
#
-# Arguments are the process number of caller, the number of state copies
-# belonging to that process, and the name of the filter_control_file for
-# that process
+# Arguments are the
+# 1) process number of caller,
+# 2) the number of state copies belonging to that process, and
+# 3) the name of the filter_control_file for that process
set process = $1
set num_states = $2
set control_file = $3
+#-------------------------------------------------------------------------
+# Block 1: populate a run-time directory with the bits needed to run rose.
+#-------------------------------------------------------------------------
+
# Get unique name for temporary working directory for this process's stuff
set temp_dir = 'advance_temp'${process}
@@ -30,48 +36,86 @@
mkdir -p $temp_dir
cd $temp_dir
-# Get the program and input.nml
-cp ../integrate_model .
+# Get the data files needed to run rose. One directory up is 'CENTRALDIR'
+
cp ../input.nml .
+cp ../rose.nml rose.nml_default
# Loop through each state
set state_copy = 1
set ensemble_member_line = 1
set input_file_line = 2
set output_file_line = 3
+
while($state_copy <= $num_states)
-
+
set ensemble_member = `head -$ensemble_member_line ../$control_file | tail -1`
set input_file = `head -$input_file_line ../$control_file | tail -1`
set output_file = `head -$output_file_line ../$control_file | tail -1`
-
- # Get the ics file for this state_copy
- mv ../$input_file temp_ic
- # Advance the model saving standard out
- # integrate_model is hardcoded to expect input in temp_ic and it creates
- # temp_ud as output.
- ./integrate_model >! integrate_model_out_temp
+ #----------------------------------------------------------------------
+ # Block 2: Convert the DART output file to form needed by model.
+ # We are going to take a POP netCDF restart file and simply overwrite the
+ # appropriate variables. The DART output file also has the 'advance_to'
+ # time - which must be communicated to the model ...
+ #----------------------------------------------------------------------
- # Append the output from the advance to the file in the working directory
- #cat integrate_model_out_temp >> ../integrate_model_out_temp$process
+ # The EXPECTED input DART 'initial conditions' file name is 'temp_ic'
+ # The dart_to_pop_nml:advance_time_present = .TRUE. must be set
- # Move the updated state vector back up
- # (temp_ud was created by integrate_model.)
- mv temp_ud ../$output_file
+ ln -sfv ../$input_file temp_ic || exit 2
+ cp -p ../rose_restart.nc . || exit 2
+ ../dart_to_model || exit 2
+
+ # Convey the new 'advance_to' time to rose via the namelist
+ # trans_time creates a teeny file called 'times' that contains
+ # the 'advance_to' time from DART in the rose format
+ # The program nmlbld_rose takes the rose template namelist and
+ # inserts the proper time and ensemble member bits.
+
+ ../trans_time
+
+ echo `cat times` >! namelist.in
+ echo $ensemble_member >> namelist.in
+# echo `cat a_tunes` >> namelist.in
+# echo `cat p_tunes` >> namelist.in
+
+ ../nmlbld_rose < namelist.in
+ echo "advance_model: after nmlbld_rose"
+
+ ls -lrt
+
+ #----------------------------------------------------------------------
+ # Block 3: Run the model
+ #----------------------------------------------------------------------
+
+ ../rose |& tee rose_out_$ensemble_member
+
+ ls -lrt
+
+ #----------------------------------------------------------------------
+ # Block 4: Convert the model output to form needed by DART
+ #----------------------------------------------------------------------
+
+ ../model_to_dart
+
+ mv temp_ud ../$output_file || exit 4
+
@ state_copy++
@ ensemble_member_line = $ensemble_member_line + 3
@ input_file_line = $input_file_line + 3
@ output_file_line = $output_file_line + 3
end
-# Change back to original directory and get rid of temporary directory
+# Change back to original directory
cd ..
-\rm -rf $temp_dir
-# Remove the filter_control file to signal completeion
-# Is there a need for any sleeps to avoid trouble on completing moves here?
+# After you are assured this script works as expected, you can actually
+# remove the temporary directory. For now ... leave this commented OUT.
+#\rm -rf $temp_dir
+
+# Remove the filter_control file to signal completion
\rm -rf $control_file
exit 0
Added: DART/trunk/models/rose/shell_scripts/run_perfect_model_obs.csh
===================================================================
--- DART/trunk/models/rose/shell_scripts/run_perfect_model_obs.csh (rev 0)
+++ DART/trunk/models/rose/shell_scripts/run_perfect_model_obs.csh 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,209 @@
+#!/bin/csh
+#
+# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# $Id$
+#
+# 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.
+#-----------------------------------------------------------------------------
+#
+#BXXX -b 18:00
+#BSUB -J rose_OSSE
+#BSUB -o rose_OSSE.%J.log
+#BSUB -N -u ${USER}@ucar.edu
+#BSUB -q economy
+#BSUB -n 16
+#BSUB -R "span[ptile=2]"
+#BSUB -W 2:00
+
+#----------------------------------------------------------------------
+# 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 rose
+ 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 -v'
+ setenv MOVE 'mv -fv'
+ breaksw
+endsw
+
+echo "${JOBNAME} ($JOBID) CENTRALDIR == $CENTRALDIR"
+
+#-----------------------------------------------------------------------------
+# Set variables containing various directory names where we will GET things
+#-----------------------------------------------------------------------------
+
+set DARTDIR = /home/coral/tmatsuo/DART/models/rose
+
+#-----------------------------------------------------------------------------
+# Get the DART executables, scripts, and input files
+#-----------------------------------------------------------------------------
+
+# executables
+
+ ${COPY} ${DARTDIR}/work/trans_perfect_ics .
+ ${COPY} ${DARTDIR}/work/perfect_model_obs .
+ ${COPY} ${DARTDIR}/work/dart_to_model .
+ ${COPY} ${DARTDIR}/work/model_to_dart .
+ ${COPY} ${DARTDIR}/work/trans_time .
+ ${COPY} ${DARTDIR}/work/nmlbld_rose .
+
+# shell scripts
+ ${COPY} ${DARTDIR}/shell_scripts/advance_model.csh .
+
+# data files
+ ${COPY} ${DARTDIR}/work/obs_seq.in .
+ ${COPY} ${DARTDIR}/work/input.nml .
+
+#-----------------------------------------------------------------------------
+# Get the rose executable, control files, and data files.
+# trying to use the CCSM naming conventions
+#-----------------------------------------------------------------------------
+
+ ${COPY} ${DARTDIR}/work/rose .
+ ${COPY} ${DARTDIR}/work/rose.nml .
+ ${COPY} ${DARTDIR}/work/rose_restart.nc .
+
+#-----------------------------------------------------------------------------
+# Check that everything moved OK, and the table is set.
+# Convert a ROSE file 'rose_restart.nc' to a DART ics file 'perfect_ics'
+#-----------------------------------------------------------------------------
+
+ ./trans_perfect_ics
+
+#-----------------------------------------------------------------------------
+# Run perfect_model_obs ... harvest the observations to populate obs_seq.out
+#-----------------------------------------------------------------------------
+
+./perfect_model_obs || exit 2
+
+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}/rose
+${MOVE} data data.cal ${experiment}/rose
+${MOVE} STD* ${experiment}/rose
+
+${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
+
+exit 0
+
+# <next few lines under version control, do not edit>
+# $URL$
+# $Revision$
+# $Date$
+
Property changes on: DART/trunk/models/rose/shell_scripts/run_perfect_model_obs.csh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
Modified: DART/trunk/models/rose/trans_perfect_ics.f90
===================================================================
--- DART/trunk/models/rose/trans_perfect_ics.f90 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/trans_perfect_ics.f90 2010-03-07 17:31:26 UTC (rev 4304)
@@ -26,13 +26,14 @@
!----------------------------------------------------------------------
use types_mod, only : r8
-use utilities_mod, only : get_unit
+use utilities_mod, only : get_unit, initialize_utilities
use model_mod, only : model_type, init_model_instance, read_ROSE_restart, &
prog_var_to_vector
use assim_model_mod, only : assim_model_type, static_init_assim_model, &
- init_assim_model, get_model_size , set_model_state_vector, write_state_restart, &
- set_model_time, open_restart_read, open_restart_write, close_restart, &
- aread_state_restart
+ init_assim_model, get_model_size , &
+ set_model_state_vector, write_state_restart, &
+ set_model_time, open_restart_read, open_restart_write, &
+ close_restart, aread_state_restart
use time_manager_mod, only : time_type, print_time
implicit none
@@ -44,8 +45,8 @@
revdate = "$Date$"
character (len = 128) :: &
- file_name = 'NMC_SOC.day151_2002.dat',&
- file_out = 'perfect_ics'
+ file_name = 'rose_restart.nc', &
+ file_out = 'perfect_ics'
! Temporary allocatable storage to read in a native format for ROSE state
type(assim_model_type) :: x
@@ -54,8 +55,10 @@
real(r8), allocatable :: x_state(:)
integer :: file_unit, x_size
+call initialize_utilities(progname='trans_perfect_ics', output_flag=.true.)
+
! Static init assim model calls static_init_model
-PRINT*,'static_init_assim_model in trans_pv_sv'
+PRINT*,'static_init_assim_model in trans_perfect_ics'
call static_init_assim_model()
! Initialize the assim_model instance
Deleted: DART/trunk/models/rose/trans_pv_sv.f90
===================================================================
--- DART/trunk/models/rose/trans_pv_sv.f90 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/trans_pv_sv.f90 2010-03-07 17:31:26 UTC (rev 4304)
@@ -1,85 +0,0 @@
-! DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
-! provided by UCAR, "as is", without charge, subject to all terms of use at
-! http://www.image.ucar.edu/DAReS/DART/DART_download
-
-
-program trans_pv_sv
-
-! <next few lines under version control, do not edit>
-! $URL$
-! $Id$
-! $Revision$
-! $Date$
-
-!----------------------------------------------------------------------
-! purpose: interface between ROSE and DART
-!
-! method: Read ROSE restart file (binary format).
-! Reform fields into a state vector.
-! Write out state vector in "proprietary" format for DART
-!
-! based on trans_pv_sv for CAM
-!
-!----------------------------------------------------------------------
-
-use types_mod, only : r8
-use utilities_mod, only : get_unit
-use model_mod, only : model_type, init_model_instance, read_ROSE_restart, &
- prog_var_to_vector
-use assim_model_mod, only : assim_model_type, static_init_assim_model, &
- init_assim_model, get_model_size , set_model_state_vector, write_state_restart, &
- set_model_time, open_restart_read, open_restart_write, close_restart, &
- aread_state_restart
-use time_manager_mod, only : time_type
-
-implicit none
-
-! version controlled file description for error handling, do not edit
-character(len=128), parameter :: &
- source = "$URL$", &
- revision = "$Revision$", &
- revdate = "$Date$"
-
-character (len = 128) :: &
- file_name = 'rose_restart.nc', &
- file_out = 'temp_ud'
-
-! Temporary allocatable storage to read in a native format for ROSE state
-type(assim_model_type) :: x
-type(model_type) :: var
-type(time_type) :: model_time
-real(r8), allocatable :: x_state(:)
-integer :: file_unit, x_size
-
-! Static init assim model calls static_init_model
-PRINT*,'static_init_assim_model in trans_pv_sv'
-call static_init_assim_model()
-
-! Initialize the assim_model instance
-call init_assim_model(x)
-
-! Allocate the local state vector
-x_size = get_model_size()
-allocate(x_state(x_size))
-
-! Allocate the instance of the ROSE model type for storage
-call init_model_instance(var)
-
-! Read the file ROSE state fragments into var
-call read_ROSE_restart(file_name, var, model_time)
-
-! transform fields into state vector for DART
-call prog_var_to_vector(var, x_state)
-
-call set_model_state_vector(x, x_state)
-
-call set_model_time(x, model_time)
-
-file_unit = open_restart_write(file_out)
-PRINT*,'In trans_pv_sv file_out unit = ',file_unit
-PRINT*,' '
-! write out state vector in "proprietary" format
-call write_state_restart(x, file_unit)
-call close_restart(file_unit)
-
-end program trans_pv_sv
Deleted: DART/trunk/models/rose/trans_sv_pv.f90
===================================================================
--- DART/trunk/models/rose/trans_sv_pv.f90 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/trans_sv_pv.f90 2010-03-07 17:31:26 UTC (rev 4304)
@@ -1,83 +0,0 @@
-! DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
-! provided by UCAR, "as is", without charge, subject to all terms of use at
-! http://www.image.ucar.edu/DAReS/DART/DART_download
-
-program trans_sv_pv
-
-! <next few lines under version control, do not edit>
-! $URL$
-! $Id$
-! $Revision$
-! $Date$
-
-!----------------------------------------------------------------------
-! purpose: interface between ROSE and DART
-!
-! method: Read DART state vector ("proprietary" format)
-! Reform state vector back into ROSE fields.
-! Replace those fields on the ROSE restart file with the new values,
-! preserving all other information on the file.
-!
-! based on prog_var_to_vector and vector_to_prog_var for CAM
-!
-!----------------------------------------------------------------------
-
-use types_mod, only : r8
-use utilities_mod, only : get_unit
-use model_mod, only : model_type, init_model_instance, &
- vector_to_prog_var, update_ROSE_restart
-use assim_model_mod, only : assim_model_type, static_init_assim_model, &
- init_assim_model, get_model_size, get_model_state_vector, read_state_restart, &
- open_restart_read, close_restart
-use time_manager_mod, only : time_type, read_time
-
-implicit none
-
-! version controlled file description for error handling, do not edit
-character(len=128), parameter :: &
- source = "$URL$", &
- revision = "$Revision$", &
- revdate = "$Date$"
-
-type(assim_model_type) :: x
-type(model_type) :: var
-type(time_type) :: adv_to_time
-real(r8), allocatable :: x_state(:)
-integer :: file_unit, x_size
-character (len = 128) :: file_name = 'rose_restart.nc', file_in = 'temp_ic'
-
-! Static init assim model calls static_init_model
-PRINT*,'static_init_assim_model in trans_sv_pv'
-
-call static_init_assim_model()
-call init_assim_model(x)
-
-! Allocate the instance of the rose model type for storage
-call init_model_instance(var)
-
-file_unit = open_restart_read(file_in)
-PRINT*,'In trans_sv_pv file_in unit = ',file_unit
-PRINT*,' '
-
-! Read in time to which ROSE must advance.
-! Neither this, nor time in x (x%time) is used in this program
-! read in state vector from DART
-call read_state_restart(x, file_unit, adv_to_time)
-call close_restart(file_unit)
-
-! Get the state part of the assim_model type x
-x_size = get_model_size()
-allocate(x_state(x_size))
-PRINT*,'(trans_sv_pv) getting model state vector of length ',x_size
-x_state = get_model_state_vector(x)
-
-! decompose vector back into ROSE fields
-PRINT*,'(trans_sv_pv) converting vector to prog_var'
-call vector_to_prog_var (x_state, var)
-deallocate (x_state)
-
-! write fields to the binary ROSE restart file
-PRINT*,'(trans_sv_pv) updating ',trim(file_name)
-call update_ROSE_restart(file_name, var)
-
-end program trans_sv_pv
Modified: DART/trunk/models/rose/trans_time.f90
===================================================================
--- DART/trunk/models/rose/trans_time.f90 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/trans_time.f90 2010-03-07 17:31:26 UTC (rev 4304)
@@ -21,9 +21,10 @@
!----------------------------------------------------------------------
use time_manager_mod, only : time_type, get_time, operator(-)
-use assim_model_mod, only : static_init_assim_model, init_assim_model, open_restart_read, close_restart, &
+use assim_model_mod, only : static_init_assim_model, init_assim_model, &
+ open_restart_read, close_restart, &
get_model_time, read_state_restart, assim_model_type
-use utilities_mod, only : get_unit
+use utilities_mod, only : get_unit, initialize_utilities
use types_mod, only : r8
implicit none
@@ -40,6 +41,8 @@
character (len = 128) :: file_name = 'temp_ic', file_out = 'times'
type(assim_model_type) :: x
+call initialize_utilities(progname='trans_time', output_flag=.true.)
+
! Static init assim model calls static_init_model
call static_init_assim_model()
call init_assim_model(x)
Copied: DART/trunk/models/rose/work/mkmf_dart_to_model (from rev 4301, DART/trunk/models/rose/work/mkmf_trans_sv_pv)
===================================================================
--- DART/trunk/models/rose/work/mkmf_dart_to_model (rev 0)
+++ DART/trunk/models/rose/work/mkmf_dart_to_model 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,18 @@
+#!/bin/csh
+#
+# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# $Id$
+
+../../../mkmf/mkmf -p dart_to_model -t ../../../mkmf/mkmf.template -c "-Duse_netCDF" \
+ -a "../../.." path_names_dart_to_model
+
+exit $status
+
+# <next few lines under version control, do not edit>
+# $URL$
+# $Revision$
+# $Date$
+
Copied: DART/trunk/models/rose/work/mkmf_model_to_dart (from rev 4301, DART/trunk/models/rose/work/mkmf_trans_pv_sv)
===================================================================
--- DART/trunk/models/rose/work/mkmf_model_to_dart (rev 0)
+++ DART/trunk/models/rose/work/mkmf_model_to_dart 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,18 @@
+#!/bin/csh
+#
+# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# $Id$
+
+../../../mkmf/mkmf -p model_to_dart -t ../../../mkmf/mkmf.template -c "-Duse_netCDF" \
+ -a "../../.." path_names_model_to_dart
+
+exit $status
+
+# <next few lines under version control, do not edit>
+# $URL$
+# $Revision$
+# $Date$
+
Added: DART/trunk/models/rose/work/mkmf_nmlbld_rose
===================================================================
--- DART/trunk/models/rose/work/mkmf_nmlbld_rose (rev 0)
+++ DART/trunk/models/rose/work/mkmf_nmlbld_rose 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,18 @@
+#!/bin/csh
+#
+# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# $Id$
+
+../../../mkmf/mkmf -p nmlbld_rose -t ../../../mkmf/mkmf.template -c "-Duse_netCDF" \
+ -a "../../.." path_names_nmlbld_rose
+
+exit $status
+
+# <next few lines under version control, do not edit>
+# $URL$
+# $Revision$
+# $Date$
+
Property changes on: DART/trunk/models/rose/work/mkmf_nmlbld_rose
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Revision Author HeadURL Id
Added: svn:eol-style
+ native
Added: DART/trunk/models/rose/work/mkmf_trans_perfect_ics
===================================================================
--- DART/trunk/models/rose/work/mkmf_trans_perfect_ics (rev 0)
+++ DART/trunk/models/rose/work/mkmf_trans_perfect_ics 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,18 @@
+#!/bin/csh
+#
+# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# $Id$
+
+../../../mkmf/mkmf -p trans_perfect_ics -t ../../../mkmf/mkmf.template -c "-Duse_netCDF" \
+ -a "../../.." path_names_trans_perfect_ics
+
+exit $status
+
+# <next few lines under version control, do not edit>
+# $URL$
+# $Revision$
+# $Date$
+
Property changes on: DART/trunk/models/rose/work/mkmf_trans_perfect_ics
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Revision Author HeadURL Id
Added: svn:eol-style
+ native
Deleted: DART/trunk/models/rose/work/mkmf_trans_pv_sv
===================================================================
--- DART/trunk/models/rose/work/mkmf_trans_pv_sv 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/work/mkmf_trans_pv_sv 2010-03-07 17:31:26 UTC (rev 4304)
@@ -1,18 +0,0 @@
-#!/bin/csh
-#
-# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
-# provided by UCAR, "as is", without charge, subject to all terms of use at
-# http://www.image.ucar.edu/DAReS/DART/DART_download
-#
-# $Id$
-
-../../../mkmf/mkmf -p trans_pv_sv -t ../../../mkmf/mkmf.template -c "-Duse_netCDF" \
- -a "../../.." path_names_trans_pv_sv
-
-exit $status
-
-# <next few lines under version control, do not edit>
-# $URL$
-# $Revision$
-# $Date$
-
Deleted: DART/trunk/models/rose/work/mkmf_trans_sv_pv
===================================================================
--- DART/trunk/models/rose/work/mkmf_trans_sv_pv 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/work/mkmf_trans_sv_pv 2010-03-07 17:31:26 UTC (rev 4304)
@@ -1,18 +0,0 @@
-#!/bin/csh
-#
-# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
-# provided by UCAR, "as is", without charge, subject to all terms of use at
-# http://www.image.ucar.edu/DAReS/DART/DART_download
-#
-# $Id$
-
-../../../mkmf/mkmf -p trans_sv_pv -t ../../../mkmf/mkmf.template -c "-Duse_netCDF" \
- -a "../../.." path_names_trans_sv_pv
-
-exit $status
-
-# <next few lines under version control, do not edit>
-# $URL$
-# $Revision$
-# $Date$
-
Added: DART/trunk/models/rose/work/mkmf_trans_time
===================================================================
--- DART/trunk/models/rose/work/mkmf_trans_time (rev 0)
+++ DART/trunk/models/rose/work/mkmf_trans_time 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,18 @@
+#!/bin/csh
+#
+# DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# $Id$
+
+../../../mkmf/mkmf -p trans_time -t ../../../mkmf/mkmf.template -c "-Duse_netCDF" \
+ -a "../../.." path_names_trans_time
+
+exit $status
+
+# <next few lines under version control, do not edit>
+# $URL$
+# $Revision$
+# $Date$
+
Property changes on: DART/trunk/models/rose/work/mkmf_trans_time
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Revision Author HeadURL Id
Added: svn:eol-style
+ native
Copied: DART/trunk/models/rose/work/path_names_dart_to_model (from rev 4301, DART/trunk/models/rose/work/path_names_trans_sv_pv)
===================================================================
--- DART/trunk/models/rose/work/path_names_dart_to_model (rev 0)
+++ DART/trunk/models/rose/work/path_names_dart_to_model 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,13 @@
+assim_model/assim_model_mod.f90
+common/types_mod.f90
+location/threed_sphere/location_mod.f90
+models/rose/dart_to_model.f90
+models/rose/dynamics_testing_DA/ncdf.mod.f
+models/rose/dynamics_testing_DA/params.mod.f
+models/rose/dynamics_testing_DA/restart.mod.f
+models/rose/model_mod.f90
+mpi_utilities/null_mpi_utilities_mod.f90
+random_nr/random_nr_mod.f90
+random_seq/random_seq_mod.f90
+time_manager/time_manager_mod.f90
+utilities/utilities_mod.f90
Modified: DART/trunk/models/rose/work/path_names_filter
===================================================================
--- DART/trunk/models/rose/work/path_names_filter 2010-03-05 22:29:43 UTC (rev 4303)
+++ DART/trunk/models/rose/work/path_names_filter 2010-03-07 17:31:26 UTC (rev 4304)
@@ -9,7 +9,7 @@
models/rose/dynamics_testing_DA/ncdf.mod.f
models/rose/dynamics_testing_DA/restart.mod.f
models/rose/model_mod.f90
-mpi_utilities/null_mpi_utilities_mod.f90
+mpi_utilities/mpi_utilities_mod.f90
obs_def/obs_def_mod.f90
obs_kind/obs_kind_mod.f90
obs_model/obs_model_mod.f90
Copied: DART/trunk/models/rose/work/path_names_model_to_dart (from rev 4301, DART/trunk/models/rose/work/path_names_trans_pv_sv)
===================================================================
--- DART/trunk/models/rose/work/path_names_model_to_dart (rev 0)
+++ DART/trunk/models/rose/work/path_names_model_to_dart 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,13 @@
+assim_model/assim_model_mod.f90
+common/types_mod.f90
+location/threed_sphere/location_mod.f90
+models/rose/dynamics_testing_DA/ncdf.mod.f
+models/rose/dynamics_testing_DA/params.mod.f
+models/rose/dynamics_testing_DA/restart.mod.f
+models/rose/model_mod.f90
+models/rose/model_to_dart.f90
+mpi_utilities/null_mpi_utilities_mod.f90
+random_nr/random_nr_mod.f90
+random_seq/random_seq_mod.f90
+time_manager/time_manager_mod.f90
+utilities/utilities_mod.f90
Added: DART/trunk/models/rose/work/path_names_nmlbld_rose
===================================================================
--- DART/trunk/models/rose/work/path_names_nmlbld_rose (rev 0)
+++ DART/trunk/models/rose/work/path_names_nmlbld_rose 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,5 @@
+common/types_mod.f90
+models/rose/nmlbld_rose.f90
+mpi_utilities/null_mpi_utilities_mod.f90
+time_manager/time_manager_mod.f90
+utilities/utilities_mod.f90
Property changes on: DART/trunk/models/rose/work/path_names_nmlbld_rose
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: DART/trunk/models/rose/work/path_names_trans_perfect_ics
===================================================================
--- DART/trunk/models/rose/work/path_names_trans_perfect_ics (rev 0)
+++ DART/trunk/models/rose/work/path_names_trans_perfect_ics 2010-03-07 17:31:26 UTC (rev 4304)
@@ -0,0 +1,17 @@
+assim_model/assim_model_mod.f90
+common/types_mod.f90
+location/threed_sphere/location_mod.f90
+models/rose/dynamics_testing_DA/dynam.mod.f
+models/rose/dynamics_testing_DA/ncdf.mod.f
+models/rose/dynamics_testing_DA/ncdf.mod.f
+models/rose/dynamics_testing_DA/params.mod.f
+models/rose/dynamics_testing_DA/phys.mod.f
+models/rose/dynamics_testing_DA/restart.mod.f
+models/rose/dynamics_testing_DA/wcont.f
+models/rose/model_mod.f90
+models/rose/trans_perfect_ics.f90
+mpi_utilities/null_mpi_utilities_mod.f90
+random_nr/random_nr_mod.f90
+random_seq/random_seq_mod.f90
+time_manager/time_manager_mod.f90
+utilities/utilities_mod.f90
Property changes on: DART/trunk/models/rose/work/path_names_trans_perfect_ics
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Deleted: DART/trunk/models/rose/work/path_names_trans_pv_sv
===================================================================
--- DART/trunk/models/rose/work/path_names_trans_pv_sv 2010-03-05 22:29:43 UTC (rev 4303)
@@ Diff output truncated at 40000 characters. @@
More information about the Dart-dev
mailing list