Changeset 4668 for BOL/Replay


Ignore:
Timestamp:
Sep 3, 2023, 3:16:49 PM (15 months ago)
Author:
fhourdin
Message:

Mise a jour pour lscp et fisrtilp

Location:
BOL/Replay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BOL/Replay/replay_clean.sh

    r4591 r4668  
    44replay_comment="replay automatic include"
    55if [ $# = 0 ] ; then
    6    \rm -f dump_replay*.h dump_param.h dump_ini.h  input tmp tmp2 tmp3 tmp2_cpp
     6   \rm -f dump_replay*.h dump_param.h dump_ini.h  input tmp_get_subroutine_arg  tmp_include_line  tmp_include_line*  tmp_include_line*_cpp  tmp_include_line*
     7
    78   for file in `grep "$replay_comment" *F90 | cut -d: -f1` ; do
    89      sed -i"" -e "/$replay_comment/d" $file
  • BOL/Replay/replay_equip.sh

    r4659 r4668  
    11#!/bin/bash
    22
    3 # set -vx
     3#set -vx
    44
    55#=============================================================================
     
    117117   wake|wake_popdyn_1|wake_popdyn_2|vdif_kcay|ustarhb) param_ini=wake_ini ; inimod=lmdz_wake_ini ; klon=klon ; klev=klev ;;
    118118   ratqs_main|ratqs_inter|ratqs_oro|ratqs_hetero|ratqs_tke) param_ini=ratqs_ini ; inimod=lmdz_ratqs_ini ; klon=klon ; klev=klev ;;
    119    lscp) param_ini=lscp_ini ; inimod=lscp_ini_mod ; klon=klon ; klev=klev ;;
     119   lscp|fisrtilp) param_ini=lscp_ini ; inimod=lmdz_lscp_ini ; klon=klon ; klev=klev ;;
    120120   *) echo Cas non prevu ; exit
    121121esac
     
    136136
    137137function get_subroutine_arg(){
    138    cat $2 | tr '[A-Z]' '[a-z]' > tmp
    139    line1=`sed -n -e '/subrou.*'\`echo $1 | tr '[A-Z]' '[a-z]'\`'.*(/=' tmp | head -1 `
    140    line2=`tail -n +$line1 tmp | sed -n -e '/)/=' | head -1`
    141    tail -n +$line1 tmp | sed -n -e 1,${line2}p
     138   tmp=tmp_get_subroutine_arg
     139   cat $2 | tr '[A-Z]' '[a-z]' > ${tmp}
     140   line1=`sed -n -e '/subrou.*'\`echo $1 | tr '[A-Z]' '[a-z]'\`'.*(/=' ${tmp} | head -1 `
     141   line2=`tail -n +$line1 ${tmp} | sed -n -e '/)/=' | head -1`
     142   tail -n +$line1 ${tmp} | sed -n -e 1,${line2}p
    142143}
    143144
     
    169170   # $2 nom du fichier
    170171   # input <- routine under treatment with small caps only
    171    ( cpp $2 2>/dev/null ) | tr '[A-Z]' '[a-z]' > tmp
     172   tmp=tmp_extract_subroutine
     173   ( cpp $2 2>/dev/null ) | tr '[A-Z]' '[a-z]' > ${tmp}
    172174   name_min=`echo $1 | tr '[A-Z]' '[a-z]'`
    173    line1=`sed -n -e "/subrou.*${name_min}.*(/=" tmp | head -1 `
    174    tail -n +$line1 tmp > tmp2
    175    line2=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" tmp2 | head -1`
    176    head -$line2 tmp2  > input
    177    \rm -f tmp tmp2
     175   line1=`sed -n -e "/subrou.*${name_min}.*(/=" ${tmp} | head -1 `
     176   tail -n +$line1 ${tmp} > ${tmp}2
     177   line2=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" ${tmp}2 | head -1`
     178   head -$line2 ${tmp}2  > input
     179   \rm -f ${tmp} ${tmp}2
    178180}
    179181
     
    199201   # Including param_dump*.h in the parameterization
    200202   #set -vx
     203   tmp=tmp_include_line
    201204   line_to_be_included=$1  ; shift
    202205   param_=$1 ; shift
     
    204207   name_min=`echo $param_ | tr [A-Z] [a-z]`
    205208   line_subroutine=`cat $paramfile_ | tr '[A-Z]' '[a-z]' | sed -n -e "/subrou.*${name_min}.*(/=" | head -1 `
    206    tail -n +$line_subroutine $paramfile_ > tmp # file starting at the subroutine instruction
    207    line_return=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" tmp | head -1`
    208    head -$line_return tmp > tmp2               # file containing the routine
    209    sed -e 's/\!.*$//' tmp2 > tmp3
    210    cpp tmp2 > tmp3 2>/dev/null
    211    cat tmp3 | tr '[A-Z]' '[a-z]' > tmp2_cpp   # same after cpp filtering
    212    last_line_declaration2="`sed -n -e 's/\!.*$//' -e 's/^/ /' -e '/[\ ,]real[\ ,]/p' -e '/[\ ,]integer[\ ,]/p' -e '/[\ ,]logical[\ ,]/p' -e '/[\ ,]character[\ ,]/p' tmp2_cpp | tail -1 | sed -e 's/  / /g' -e 's/ /.*/g'`"
    213    line_last_declaration=`cat tmp2 | tr '[A-Z]' '[a-z]' | sed -n -e "/$last_line_declaration2/="`
     209   tail -n +$line_subroutine $paramfile_ > ${tmp} # file starting at the subroutine instruction
     210   line_return=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" ${tmp} | head -1`
     211   head -$line_return ${tmp} > ${tmp}2               # file containing the routine
     212   sed -e 's/\!.*$//' ${tmp}2 > ${tmp}3
     213   cpp ${tmp}2 > ${tmp}3 2>/dev/null
     214   cat ${tmp}3 | tr '[A-Z]' '[a-z]' > ${tmp}2_cpp   # same after cpp filtering
     215   last_line_declaration2="`sed -n -e 's/\!.*$//' -e 's/^/ /' -e '/[\ ,]real[\ ,]/p' -e '/[\ ,]integer[\ ,]/p' -e '/[\ ,]logical[\ ,]/p' -e '/[\ ,]character[\ ,]/p' ${tmp}2_cpp | tail -1 | sed -e 's/  / /g' -e 's/ /.*/g'`"
     216   line_last_declaration=`cat ${tmp}2 | tr '[A-Z]' '[a-z]' | sed -n -e "/$last_line_declaration2/="`
    214217   echo OK0
    215218   if [ "`grep -i 'end.*module' $paramfile_`" = "" ] ; then echo aka ;  line_end_module=`wc -l $paramfile_ | awk ' { print $1 } '` ; else echo akb ; line_end_module=`sed -n -e '/[eE][nN][dD] .*[mM][oO][dD][uU][lL][eE]/=' $paramfile_` ; fi
     
    223226         -before_return)           targeted_line=$line_return ;;
    224227         -before_end_module)       targeted_line=$line_end_module ;;
    225          -before_line|-after_line) linestr=`echo $1 | sed -e "s/$wtype //"` ; targeted_line=`sed -n -e "/$linestr/=" tmp2` ;;
     228         -before_line|-after_line) linestr=`echo $1 | sed -e "s/$wtype //"` ; targeted_line=`sed -n -e "/$linestr/=" ${tmp}2` ;;
    226229         *)                  echo Cas non prevu 0 where=$where in include_file
    227230      esac
     
    429432   close(90)
    430433...eod...............................................
     434   for var_ in $varinmod ; do echo "print*,'Interface $param_ini $var_',$var_" >> $iniinc ; done
    431435   include_line "include \"$iniinc\"" $param_ini $inimod.F90  -before_return
    432436fi # nconly = false
    433 
    434437
    435438#-----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.