Ignore:
Timestamp:
2015-06-19T17:18:00+02:00 (5 years ago)
Author:
davestorkey
Message:

Update 2015/dev_r5021_UKMO1_CICE_coupling branch to revision 5442 of the trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5021_UKMO1_CICE_coupling/NEMOGCM/TOOLS/MISCELLANEOUS/rewrite_nemo.sh

    r3294 r5443  
    11#!/bin/bash 
     2# 
     3# rsync -av NEMO/ NEMO_no_wrkarrays/ 
     4# cd NEMO_no_wrkarrays/ 
     5# ../TOOLS/MISCELLANEOUS/rewrite_nemo.sh 
     6# cd ../CONFIG 
     7# ./makenemo -n ORCA2_LIM3 -s NEMO_no_wrkarrays 
    28# 
    39set -u 
    410#set -xv 
    511# 
    6 # for on each file containing a call to work alloc (exept BDY files that are too complicated...) 
    7 #for i in $( ack -il "^ *call *wrk_alloc *\(" | grep -v BDY ) 
    8 for i in $( egrep -iRl "^ *call *wrk_alloc *\(" * | grep "90$" | grep -v BDY ) 
     12# for on each file containing a call to work alloc 
     13for i in $( grep -iRl "^[^\!]*call *wrk_alloc *(" * | grep "90$" ) 
    914do 
    1015# create a temporary file that will be easier to process... 
     
    2833# 
    2934# number of the lines containing wrk_alloc 
    30     cnt=$( grep -ci "^ *call *wrk_alloc *(" tmp$$ ) 
     35    cnt=$( grep -ci "^[^\!]*call *wrk_alloc *(" tmp$$ ) 
    3136# for each of these lines 
    3237    ll=1 
     
    3439    do 
    3540# get the line with its number 
    36    line=$( grep -in "^ *call *wrk_alloc *(" tmp$$ | sed -n ${ll}p | sed -e "s/\!.*//" ) 
     41   line=$( grep -in "^[^\!]*call *wrk_alloc *(" tmp$$ | sed -n ${ll}p | sed -e "s/\!.*//" ) 
    3742# get its number 
    3843   lline=$( echo $line | sed -e "s/:.*//" ) 
    3944# keep only the arument of wrk_alloc between () 
    40    line=$( echo $line | sed -e "s/[^(]*\((.*)\).*/\1/" | sed -e "s/, *k[ijkl]start *=[^,]*,/,/" | sed -e "s/, *k[ijkl]start *=.*)/ )/" ) 
     45   line=$( echo $line | sed -e "s/^.*[cC][aA][lL][lL] *[wW][rR][kK]_[aA][lL][lL][oO][cC]//" | sed -e "s/[^(]*\((.*)\).*/\1/" | sed -e "s/, *k[ijkl]start *=[^,]*,/,/" | sed -e "s/, *k[ijkl]start *=.*)/ )/" ) 
    4146# find in which subroutine or function is located this call to wrk_alloc: l1 beginning l2: end 
    4247   for lll in $linesbegin 
     
    132137# 
    133138# OPA_SRC/SBC/albedo.F90 
    134 sed -e "s/DIMENSION(jpi,jpj,ijpl)/DIMENSION(jpi,jpj,SIZE(pt_ice,3))/" OPA_SRC/SBC/albedo.F90 > tmp$$ 
     139sed -e "s/DIMENSION(jpi,jpj,ijpl/DIMENSION(jpi,jpj,SIZE(pt_ice,3)/" OPA_SRC/SBC/albedo.F90 > tmp$$ 
    135140mv tmp$$ OPA_SRC/SBC/albedo.F90 
     141# see result of 
     142#    grep -i "wrk_alloc" $( find . -name "*90" ) | grep "=" 
     143# 
    136144# LIM_SRC_2/limrhg_2.F90 
    137 sed -e "s/DIMENSION(jpi,jpj+2)/DIMENSION(jpi,0:jpj+1)/" LIM_SRC_2/limrhg_2.F90 > tmp$$ 
     145#./LIM_SRC_2/limrhg_2.F90:      CALL wrk_alloc( jpi,jpj+2, zu0, zv0, zu_n, zv_n, zu_a, zv_a, zviszeta, zviseta, kjstart = 0 ) 
     146#./LIM_SRC_2/limrhg_2.F90:      CALL wrk_alloc( jpi,jpj+2, zzfrld, zztms, zi1, zi2, zmasst, zpresh, kjstart = 0 ) 
     147sed -e "s/DIMENSION(jpi,jpj+2/DIMENSION(jpi,0:jpj+1/" LIM_SRC_2/limrhg_2.F90 > tmp$$ 
    138148mv tmp$$ LIM_SRC_2/limrhg_2.F90 
     149 
    139150# LIM_SRC_3/limitd_me.F90 
     151#./LIM_SRC_3/limitd_me.F90:      CALL wrk_alloc( jpi,jpj,jpl+2, Gsum, kkstart = -1 ) 
    140152sed -e "s/DIMENSION(jpi,jpj,jpl+2)/DIMENSION(jpi,jpj,-1:jpl)/" LIM_SRC_3/limitd_me.F90 > tmp$$ 
    141153mv tmp$$ LIM_SRC_3/limitd_me.F90 
     154 
    142155# LIM_SRC_3/limitd_th.F90 
     156#./LIM_SRC_3/limitd_th.F90:      CALL wrk_alloc( jpi,jpj,jpl+1, zhbnew, kkstart = 0 )    
    143157sed -e "s/DIMENSION(jpi,jpj,jpl+1)/DIMENSION(jpi,jpj,0:jpl)/" LIM_SRC_3/limitd_th.F90 > tmp$$ 
    144158mv tmp$$ LIM_SRC_3/limitd_th.F90 
     159 
    145160# LIM_SRC_3/limthd_dif.F90 
     161#./LIM_SRC_3/limthd_dif.F90:      CALL wrk_alloc( jpij,nlay_i+1, ztcond_i, zradtr_i, zradab_i, zkappa_i, ztib, zeta_i, ztitemp, z_i, zspeche_i, kjstart=0 ) 
     162#./LIM_SRC_3/limthd_dif.F90:      CALL wrk_alloc( jpij,nlay_s+1,           zradtr_s, zradab_s, zkappa_s, ztsb, zeta_s, ztstemp, z_s, kjstart=0 ) 
    146163sed -e "s/DIMENSION(kiut,nlay_i+1)/DIMENSION(kiut,0:nlay_i)/" \ 
    147164    -e "s/DIMENSION(kiut,nlay_s+1)/DIMENSION(kiut,0:nlay_s)/" LIM_SRC_3/limthd_dif.F90 > tmp$$ 
    148165mv tmp$$ LIM_SRC_3/limthd_dif.F90 
     166 
    149167# LIM_SRC_3/limthd_ent.F90 
    150 sed -e "s/DIMENSION(jpij,jkmax+4)/DIMENSION(jpij,0:jkmax+3)/" \ 
    151     -e "s/DIMENSION(jkmax+4,jkmax+4)/DIMENSION(0:jkmax+3,0:jkmax+3)/" LIM_SRC_3/limthd_ent.F90 > tmp$$ 
     168#./LIM_SRC_3/limthd_ent.F90:      CALL wrk_alloc( jpij, nlay_i+3, zqh_cum0, zh_cum0, kjstart = 0 ) 
     169#./LIM_SRC_3/limthd_ent.F90:      CALL wrk_alloc( jpij, nlay_i+1, zqh_cum1, zh_cum1, kjstart = 0 ) 
     170sed -e "s/DIMENSION(jpij,nlay_i+3)/DIMENSION(jpij,0:nlay_i+2)/" \ 
     171    -e "s/DIMENSION(jpij,nlay_i+1)/DIMENSION(jpij,0:nlay_i)/" LIM_SRC_3/limthd_ent.F90 > tmp$$ 
    152172mv tmp$$ LIM_SRC_3/limthd_ent.F90 
     173 
    153174# OPA_SRC/DYN/divcur.F90 
     175#./OPA_SRC/DYN/divcur.F90:      CALL wrk_alloc( jpi+4, jpj  , zwv, kjstart = -1 ) 
    154176sed -e "s/DIMENSION(jpi+4,jpj)/DIMENSION(-1:jpi+2,jpj)/" OPA_SRC/DYN/divcur.F90 > tmp$$ 
    155177mv tmp$$ OPA_SRC/DYN/divcur.F90 
     178 
    156179# OPA_SRC/LDF/ldfslp.F90 
     180#./OPA_SRC/LDF/ldfslp.F90:      CALL wrk_alloc( jpi,jpj,jpk,2, zdxrho , zdyrho, zdzrho,              klstart = 0  ) 
     181#./OPA_SRC/LDF/ldfslp.F90:      CALL wrk_alloc( jpi,jpj,  2,2, zti_mlb, ztj_mlb,        kkstart = 0, klstart = 0  ) 
    157182sed -e "s/DIMENSION(jpi,jpj,jpk,2)/DIMENSION(jpi,jpj,jpk,0:1)/" \ 
    158183    -e "s/DIMENSION(jpi,jpj,2,2)/DIMENSION(jpi,jpj,0:1,0:1)/" OPA_SRC/LDF/ldfslp.F90 > tmp$$ 
    159184mv tmp$$ OPA_SRC/LDF/ldfslp.F90 
    160185# OPA_SRC/ZDF/zdfkpp.F90 
     186#./OPA_SRC/ZDF/zdfkpp.F90:      CALL wrk_alloc( jpi,3, zmoek, kjstart = 0 ) 
    161187sed -e "s/DIMENSION(jpi,3) *::* zmoek/DIMENSION(jpi,0:2) ::   zmoek/" OPA_SRC/ZDF/zdfkpp.F90 > tmp$$ 
    162188mv tmp$$ OPA_SRC/ZDF/zdfkpp.F90 
    163189 
    164 # link for limrhg.F90... 
     190# links  
     191# see result of 
     192# find . -type l 
     193# 
     194# ./LIM_SRC_2/limrhg.F90 
    165195cd LIM_SRC_2 
    166196ln -sf ../LIM_SRC_3/limrhg.F90 . 
     197cd .. 
     198 
     199# ./OOO_SRC/dtadyn.F90 
     200cd OOO_SRC 
     201ln -sf ../OFF_SRC/dtadyn.F90 . 
     202cd .. 
     203 
     204# ./OOO_SRC/obs_fbm.F90 
     205cd OOO_SRC 
     206ln -sf ../OPA_SRC/OBS/obs_fbm.F90 . 
     207cd .. 
Note: See TracChangeset for help on using the changeset viewer.