Back to home page

MITgcm

 
 

    


Warning, /jobs/run_optim.csh is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit c00939f0 on 2003-11-06 21:59:59 UTC
c00939f069 Patr*0001 #!/bin/csh
                0002 # script for running line search routine
                0003 # * set line search parameters
                0004 # * link control and gradient vector
                0005 # * generate runtime parameter files
                0006 # * run line search
                0007 # heimbach@mit.edu 27-May-2003
                0008 
                0009 # set parameters for namelist ECCO_OPTIM
                0010 set optimcycle = 0
                0011 set numiter    = 1
                0012 set nfunc      = 3
                0013 set fmin       = 300.
                0014 set iprint     = 10
                0015 set nupdate    = 4
                0016 
                0017 # set parameters for namelist ECCO_PARMS
                0018 set expId = MIT_CE_000
                0019 
                0020 # set parameters for namelist CTRL_NML and CTRL_PACKNAMES
                0021 set ctrlname = ecco_ctrl
                0022 set costname = ecco_cost
                0023 
                0024 # set system parameters
                0025 set mitgcmdir = /cluster/scratch/month01/heimbach/ecco-branch/exe
                0026 set optimdir = /cluster/scratch/month01/heimbach/ecco-branch/optim/exe
                0027 
                0028 # IDEALLY, NO MORE EDITING BEYOND THIS LINE.
                0029 # ---------------------------------------------------------------------
                0030 
                0031 # do some stuff
                0032 #
                0033 if ( $optimcycle < 10 ) then
                0034   set optsuffix = 000${optimcycle}
                0035 else if ( $optimcycle < 100 ) then
                0036   set optsuffix = 00${optimcycle}
                0037 else if ( $optimcycle < 1000 ) then
                0038   set optsuffix = 0${optimcycle}
                0039 else
                0040   set optsuffix = ${optimcycle}
                0041 endif
                0042 
                0043 # go to wrkdir and proceed:
                0044 #
                0045 cd $optimdir
                0046 rm -f data.*
                0047 if ( $optimcycle == 0 ) then
                0048   rm -f OPWARM? PH_?.dat *.opt0001 fort.94
                0049 endif
                0050 
                0051 cat >! data.optim << EOF
                0052 # ********************************
                0053 # Off-line optimization parameters
                0054 # ********************************
                0055  &ECCO_OPTIM
                0056  optimcycle = $optimcycle,
                0057  numiter    = $numiter,
                0058  nfunc      = $nfunc,
                0059  fmin       = $fmin,
                0060  iprint     = $iprint,
                0061  nupdate    = $nupdate,
                0062  &
                0063 EOF
                0064 
                0065 cat >! data.ecco << EOF
                0066 # ***************
                0067 # ECCO parameters
                0068 # ***************
                0069  &ECCO_PARMS
                0070  expId = '${expId}',
                0071  &
                0072 EOF
                0073 
                0074 cat >! data.ctrl << EOF
                0075 # *********************
                0076 # ECCO controlvariables
                0077 # *********************
                0078  &CTRL_NML
                0079  &
                0080 # *********************
                0081 # names for ctrl_pack/unpack
                0082 # *********************
                0083  &CTRL_PACKNAMES
                0084  ctrlname = '${ctrlname}',
                0085  costname = '${costname}',
                0086  &
                0087 EOF
                0088 
                0089 ln -s ${mitgcmdir}/${ctrlname}_${expId}.opt${optsuffix} .
                0090 ln -s ${mitgcmdir}/${costname}_${expId}.opt${optsuffix} .
                0091 
                0092 ./optim.x >&! output_${optsuffix}.txt
                0093 
                0094 exit
                0095