[12874] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | # for compilation |
---|
| 4 | CFG_TYPE='cfgs' |
---|
| 5 | |
---|
| 6 | # data |
---|
| 7 | DATA_NAME='' |
---|
| 8 | |
---|
| 9 | # restart list |
---|
| 10 | RST_LST='icb ice trc' |
---|
| 11 | |
---|
| 12 | # Agrif |
---|
| 13 | USE_AGRIF=0 |
---|
| 14 | NZOOM_AGRIF=0 |
---|
| 15 | |
---|
| 16 | # length simulation |
---|
| 17 | ITEND=992 ; STOCK=$((ITEND/2)) |
---|
| 18 | ITEND1=1984 ; STOCK1=$((ITEND1/2)) |
---|
| 19 | |
---|
| 20 | # processor set up |
---|
| 21 | JPNI_REF=4 ; JPNJ_REF=8 ; NPROC_REF=$((JPNI_REF*JPNJ_REF)) |
---|
| 22 | JPNI_MPP=8 ; JPNJ_MPP=4 ; NPROC_MPP=$((JPNI_MPP*JPNJ_MPP)) |
---|
| 23 | |
---|
| 24 | # namelist setup |
---|
| 25 | # define set_namelist_common function (could the REF setting) |
---|
| 26 | define_namelist_common() { |
---|
| 27 | set_namelist namelist_cfg nn_it000 1 |
---|
| 28 | set_namelist namelist_cfg nn_itend $ITEND |
---|
| 29 | set_namelist namelist_cfg nn_stock $STOCK |
---|
| 30 | set_namelist namelist_cfg jpni $JPNI_REF |
---|
| 31 | set_namelist namelist_cfg jpnj $JPNJ_REF |
---|
| 32 | set_namelist namelist_cfg ln_ctl .false. |
---|
| 33 | set_namelist namelist_cfg sn_cfctl%l_config .true. |
---|
| 34 | set_namelist namelist_cfg sn_cfctl%l_runstat .true. |
---|
| 35 | set_namelist namelist_cfg sn_cfctl%l_trcstat .true. |
---|
| 36 | set_namelist namelist_cfg ln_linssh .true. |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | # SHOULD this be in all_function with CONFIG as argument (need to see how it will work for AGRIF)? |
---|
| 40 | # define set_namelist_REF function (that overwrite the default value set in common) |
---|
| 41 | define_namelist_ref() { |
---|
| 42 | set_namelist namelist_cfg cn_exp \"${CONFIG}_ST_REF\" |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | # SHOULD this be in all_function with CONFIG and STOCK as argument (need to see how it will work for AGRIF)? |
---|
| 46 | # define set_namelist_RST function (that overwrite the default value set in common) |
---|
| 47 | define_namelist_rst() { |
---|
| 48 | set_namelist namelist_cfg cn_exp \"${CONFIG}_ST_RST\" |
---|
| 49 | set_namelist namelist_cfg nn_it000 $((STOCK+1)) |
---|
| 50 | set_namelist namelist_top_cfg ln_rsttr .true. |
---|
| 51 | set_namelist namelist_top_cfg nn_rsttr 2 |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | # SHOULD this be in all_function with CONFIG and JPNI_MPP JPNJ_MPP as argument (need to see how it will work for AGRIF)? |
---|
| 55 | # define set_namelist_MPP function (that overwrite the default value set in common) |
---|
| 56 | define_namelist_MPP() { |
---|
| 57 | set_namelist namelist_cfg cn_exp \"${CONFIG}_ST_MPP\" |
---|
| 58 | set_namelist namelist_cfg jpni $JPNI_MPP |
---|
| 59 | set_namelist namelist_cfg jpnj $JPNJ_MPP |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | # SHOULD this be in all_function with CONFIG and L_NPROC, STOCK RST_LST as argument (need to see how it will work for AGRIF)? |
---|
| 63 | link_restart() { |
---|
| 64 | for (( i=1; i<=$NPROC; i++)) ; do |
---|
| 65 | L_NPROC=$(( $i - 1 )) |
---|
| 66 | L_NPROC=`printf "%04d\n" ${L_NPROC}` |
---|
| 67 | NSTOCK8d=`printf '%08d\n' ${$STOCK}` |
---|
| 68 | ln -sf ../REF/${CONFIG}_ST_REF_${NSTOCK8d}_restart_${L_NPROC}.nc restart_${L_NPROC}.nc |
---|
| 69 | for rst in $RST_LST; do |
---|
| 70 | ln -sf ../REF/${CONFIG}_ST_REF_${NSTOCK8d}_restart_${rst}_${L_NPROC}.nc restart_${rst}_${L_NPROC}.nc |
---|
| 71 | done |
---|
| 72 | done |
---|
| 73 | } |
---|