Changes between Version 53 and Version 54 of Projects/NEMOVAR/Notes


Ignore:
Timestamp:
14/07/15 11:29:23 (4 years ago)
Author:
cthomas
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Projects/NEMOVAR/Notes

    v53 v54  
    284284The script that steers the job is called `run_nemo_cice`.  
    285285It has different sections for nemo_cice_obsoper and nemo_cice_iau.  
     286 
     287The common part governs some setup and the running of the model.  
     288Extracts from the common part are: 
     289{{{ 
     290# MODE - ['standalone', 'obsoper', 'iau'] 
     291# CYCLE_LENGTH - ISO8601 duration specifying the length of this cycle 
     292# RUNID - identifying string 
     293# INDIR_EXEC - path to executable 
     294# INDIR_FLUXES - directory containing fluxes 
     295# INDIR_ANCILLARY - directory containing ancillary files 
     296# INDIR_BACKGROUND_RESTARTS - directory containing background restarts 
     297# OUTDIR_ANALYSIS_RESTARTS - directory in which we put analysis restarts 
     298# NEMO_IPROC - NEMO processors east-west 
     299# NEMO_JPROC - NEMO processors north-south 
     300# NEMO_NPROC - total number of NEMO processors 
     301# CICE_COL - number of columns for CICE 
     302# CICE_ROW - number of rows for CICE 
     303 
     304NEMO_NL=namelist 
     305CICE_NL=ice_in 
     306 
     307# Link in common inputs 
     308mkdir -p $CYLC_TASK_WORK_DIR/fluxes 
     309ln -sf $INDIR_FLUXES/* $CYLC_TASK_WORK_DIR/fluxes 
     310ln -sf $INDIR_ANCILLARY/* $CYLC_TASK_WORK_DIR 
     311ln -sf $INDIR_BACKGROUND_RESTARTS/* $CYLC_TASK_WORK_DIR 
     312 
     313# Re-link the coordinate and geothermal heating files per processor 
     314i=0 
     315while [[ $i -lt $NEMO_NPROC ]]; do 
     316    ln -sf coordinates.nc coordinates_$(printf "%04d" $i).nc 
     317    ln -sf geothermal_heating.nc geothermal_heating_$(printf "%04d" $i).nc 
     318    let i=i+1 
     319done 
     320 
     321# Modify main NEMO namelist 
     322update_namelist $NEMO_NL cn_exp "'${RUNID}o'" 
     323update_namelist $NEMO_NL ln_rstart .true. 
     324update_namelist $NEMO_NL nn_rstctl 0 
     325update_namelist $NEMO_NL nn_it000 1 
     326update_namelist $NEMO_NL nn_itend ${TIME_STEPS_PER_CYCLE} 
     327update_namelist $NEMO_NL nn_date0 "$(rose date -c -f %Y%m%d)" 
     328update_namelist $NEMO_NL nn_leapy ${NEMO_LEAP_YEAR_FLAG} 
     329update_namelist $NEMO_NL jpni ${NEMO_IPROC} 
     330update_namelist $NEMO_NL jpnj ${NEMO_JPROC} 
     331update_namelist $NEMO_NL jpnij ${NEMO_NPROC} 
     332update_namelist $NEMO_NL nitiaufin ${TIME_STEPS_PER_DAY} 
     333 
     334# Modify main CICE namelist 
     335update_namelist $CICE_NL days_per_year ${DAYS_IN_YEAR} 
     336update_namelist $CICE_NL history_file "'${RUNID}i.${CICE_HISTFREQ_N}${CICE_HISTFREQ}'" #CT - could remove? 
     337update_namelist $CICE_NL ice_ic "'cice_restart.dat'" 
     338update_namelist $CICE_NL incond_file "'${RUNID}i_ic'" 
     339update_namelist $CICE_NL istep0 ${TIME_STEPS_TO_START} 
     340update_namelist $CICE_NL npt ${TIME_STEPS_PER_CYCLE} 
     341update_namelist $CICE_NL restart .true. 
     342update_namelist $CICE_NL restart_file "'cice_restart.dat'" 
     343update_namelist $CICE_NL use_leap_years ${CICE_LEAP_YEAR_FLAG} 
     344update_namelist $CICE_NL year_init $(rose date -c -f %Y) 
     345 
     346echo ${INDIR_EXEC}/nemo.exe:${NEMO_NPROC} > Ocean.conf 
     347rose mpi-launch -f Ocean.conf 
     348NEMO_RC=$? 
     349}}} 
    286350 
    287351 
     
    366430}}} 
    367431 
    368 The key file in this step is `run_nemo_cice` 
    369432 
    370433 
    371434==== run_nemo_cice ==== 
     435 
     436Parts of `run_nemo_cice` that are specific to the obsoper stage.  
     437 
     438Before the model has run: 
     439{{{ 
     440    echo 'obsoper linking' 
     441    # Altimeter bias 
     442    ln -sf $INDIR_ALTBIAS/* $CYLC_TASK_WORK_DIR 
     443    # Observations 
     444    ln -sf $INDIR_OBSERVATIONS/* $CYLC_TASK_WORK_DIR 
     445 
     446    function handle_observations { 
     447        # Usage: handle_observations prefix namelist_file_list namelist_flags... 
     448        PREFIX="$1"; shift; 
     449        NL_FILE_LIST="$1"; shift; 
     450 
     451        # Gather the list of observation files 
     452        FILES="" 
     453        for file in "${PREFIX}"_0*.nc ; do 
     454            FILES="${FILES} '${file}'" 
     455        done 
     456 
     457        # If we find any observations 
     458        if [ ! -z "${FILES}" ] ; then 
     459            echo "Found ${PREFIX} observations ${FILES}" 
     460 
     461            # Write the list of files into the namelist 
     462            echo "Updating ${NL_FILE_LIST} with ${FILES}" 
     463            update_namelist $NEMO_NL "${NL_FILE_LIST}" "${FILES}" 
     464 
     465            # Set all the specified namelist flags (the remainder of the arguments) to true 
     466            for FLAG in "${@}" ; do 
     467                update_namelist $NEMO_NL ${FLAG} ".true." 
     468            done 
     469        fi 
     470    } 
     471 
     472    handle_observations seaice seaicefbfiles ln_seaicefb ln_seaice 
     473    handle_observations sla slafbfiles ln_slafb ln_sla 
     474    handle_observations sst sstfbfiles ln_sstfb ln_sst 
     475}}} 
     476 
     477After the model has run: 
     478{{{ 
     479        echo copying innovations 
     480        # copy innovations into the right place 
     481        mkdir -p $OUTDIR_INNOVATIONS 
     482        # rebuild the innovations into the output directory 
     483        cd ${CYLC_TASK_WORK_DIR} 
     484        for OBSFILE in sstfb slafb seaicefb; do 
     485            echo rebuilding and copying ${OBSFILE} 
     486            ${EXEC_NEMOVAR}/fbcomb.exe ${OUTDIR_INNOVATIONS}/${OBSFILE}_01.nc ./${OBSFILE}*fdbk_*.nc 
     487        done 
     488        cd - 
     489        # copy 'assim background' file into the right place 
     490        echo copying assim background 
     491        mkdir -p $OUTDIR_ASSIM_BACKGROUND 
     492        ln -sf ${CYLC_TASK_WORK_DIR}/assim_background_state_Jb*.nc ${OUTDIR_ASSIM_BACKGROUND} 
     493}}} 
     494 
    372495 
    373496