New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
pisces.driver in branches/UKMO/r6232_tracer_advection/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/IGCM00/COMP – NEMO

source: branches/UKMO/r6232_tracer_advection/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/IGCM00/COMP/pisces.driver @ 9295

Last change on this file since 9295 was 9295, checked in by jcastill, 6 years ago

Remove svn keywords

File size: 3.0 KB
RevLine 
[1379]1#!/bin/ksh
2
3#-----------------------------------
[1631]4function MBG_Initialize
[1379]5{ 
[1631]6    IGCM_debug_PushStack "MBG_Initialize"
[1379]7
[1764]8# Local function to find namelists parameters
9supergrep () {
10    grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
11}
12
[1631]13    ##--Variables used by MBG --
[1379]14
15    # lrsttr    boolean term for tracer model restart (true or false)
16    # nrsttr    control of the time step (0, 1 or 2)
17   
18    ##--Variables used by PISCES --
19 
[1631]20    PAT_TOP_LRSTTR=$( supergrep ln_rsttr                 ${SUBMIT_DIR}/PARAM/namelist_top )
[1392]21    PAT_TOP_NRSTTR=$( supergrep nrsttr                   ${SUBMIT_DIR}/PARAM/namelist_top )
[1764]22    PAT_PIS_LRIVER=$( supergrep ln_river                 ${SUBMIT_DIR}/PARAM/namelist_pisces )
[1379]23
[1631]24    IGCM_debug_PopStack "MBG_Initialize"
[1379]25}
26
27#-----------------------------------
[1631]28function MBG_Update
[1379]29{
[1631]30    IGCM_debug_PushStack "MBG_Update"
[1379]31
32
[1764]33    ##--Write Frequency Purpose
34    Nbfreq=$( echo ${config_MBG_WriteFrequency} | wc -w )
35    typeset -Z1 i=1
36    while [ $i -le ${Nbfreq} ]; do
37       topfrequency=$( echo ${config_MBG_WriteFrequency} | awk -v var="$i" "-F " '{print $var}' )
38       topfactor=$( echo ${topfrequency} | sed -e "s/[yYmMdD]//" )
39       case ${topfrequency} in
40         *Y|*y)
41            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}y_${DatesPeriod} ;
42            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_Y} ;
43            eval WFT${i}=${topfactor}Y ;;
44         *M|*m)
45            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}m_${DatesPeriod} ;
46            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_M} ;
47            eval WFT${i}=${topfactor}M ;;
48         *D|*d)
49            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}d_${DatesPeriod} ;
50            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_D} ;
51            eval WFT${i}=${topfactor}D ;;
52         *)
53      esac
54       let i=$i+1
55    done
56
[1379]57    ##-- Restart configuration
[1631]58    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "n" ] ) ; then
[1379]59
60        #echo "NO RESTART FOR TOP"
61        TOP_LRSTTR=.FALSE.
62        TOP_NRSTTR=0
63
[1764]64        PISCES_LRIVER=.FALSE.
65
[1631]66    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "y" ] ) ; then
[1379]67
68        #echo "RESTART TOP"
69        TOP_LRSTTR=.TRUE.
70        TOP_NRSTTR=0
71
[1764]72        PISCES_LRIVER=.TRUE.
73
[1379]74    else
75
76        #echo "RESTART TOP"
77        TOP_LRSTTR=.TRUE.
78        TOP_NRSTTR=2
[1764]79
80        PISCES_LRIVER=.TRUE.
81
[1379]82    fi
83
[1764]84# on force les sorties PISCES comme les sorties OPA
85
86    sed -e "s%${PAT_TOP_LRSTTR}%          ln_rsttr=${TOP_LRSTTR}%"                   \
[1379]87        -e "s%${PAT_TOP_NRSTTR}%          nrsttr=${TOP_NRSTTR}%"                   \
88        namelist_top > namelist_top.tmp
89
90    IGCM_sys_Mv namelist_top.tmp namelist_top
91
[1764]92    sed -e "s%${PAT_PIS_LRIVER}%          ln_river=${PISCES_LRIVER}%"                \
[1379]93        namelist_pisces > namelist_pisces.tmp
94
95    IGCM_sys_Mv namelist_pisces.tmp namelist_pisces
96
97
[1631]98    IGCM_debug_PopStack "MBG_Update"
[1379]99}
100
101#-----------------------------------
[1631]102function MBG_Finalize
[1379]103{
[1631]104    IGCM_debug_PushStack "MBG_Finalize"
[1379]105
[1631]106    echo FINALIZE MBG !!!
[1379]107
[1631]108    IGCM_debug_PopStack "MBG_Finalize"
[1379]109}
110
Note: See TracBrowser for help on using the repository browser.