Changeset 5442


Ignore:
Timestamp:
Dec 21, 2024, 12:10:58 PM (9 days ago)
Author:
fhourdin
Message:

For f90 input files (from testing of dec 2024)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/Replay/replay_equip.sh

    r5038 r5442  
    5353#  * dump_param2.h          : écriture des sorties de la routines dans phys.nc
    5454#  * call_param_replay : sous programme d'appelle en boucle à la param
    55 #  * dump_ini_module.F90   : écriture de l'interface "in" de param_ini
    56 #  * call_ini_replay.F90    : lecture de l'interface "in" de param_ini
     55#  * dump_ini_module.${f90}   : écriture de l'interface "in" de param_ini
     56#  * call_ini_replay.${f90}    : lecture de l'interface "in" de param_ini
    5757#                dans ${param_ini}_mod.bin.
    5858#  Par ailleurs, un programme replay1d a été ajouté dans phylmd/dyn1d
    5959#        qui appelle call_param_replay
    6060#  Le script ajoute par ailleurs quelques lignes dans ${paramfile} et
    61 #        ${param_ini}.F90
     61#        ${param_ini}.${f90}
    6262#  replay_clean.sh élimine toutes les lignes ajoutées
    6363#
     
    7373#
    7474#=============================================================================
     75
     76f90=f90
    7577
    7678#-----------------------------------------------------------------------------
     
    108110     -ncvars) ncvars="`echo $2 | sed -e 's/,/ /g'`" ; shift ; shift ;;
    109111     -lonlat) lonlat=$2 ; shift ; shift ;;
    110      *) if (( $# > 1 )) ; then $0 -h ; exit ; fi ; param=`basename $1 .F90` ; shift
     112     *) if (( $# > 1 )) ; then $0 -h ; exit ; fi ; param=`basename $1 .${f90}` ; shift
    111113    esac
    112114done
     
    129131paraminc2=dump_replay_${param}_nc_${prefix}.h
    130132iniinc=dump_replay_ini.h
    131 paramfile=`grep -i "subro.* ${param}[\ (]" *.F90 | sed -e 's/ //g' | grep "${param}(" | cut -d: -f1`
     133paramfile=`grep -i "subro.* ${param}[\ (]" *.${f90} | sed -e 's/ //g' | grep "${param}(" | cut -d: -f1`
    132134echo ===================================================================================
    133135echo Equiping $param contained in file $paramfile
     
    339341
    340342#-----------------------------------------------------------------------------
    341 # On nettoye les inclusions précédente dans les fichiers .F90
     343# On nettoye les inclusions précédente dans les fichiers .${f90}
    342344#-----------------------------------------------------------------------------
    343345
    344346if [ $nconly = false ] ; then
    345    for file in `grep "$replay_comment" *.F90 2> /dev/null | cut -d: -f1` ; do
     347   for file in `grep "$replay_comment" *.${f90} 2> /dev/null | cut -d: -f1` ; do
    346348      sed -i"" -e "/$replay_comment/d" $file
    347349   done
     
    407409if [ $nconly = false ] ; then
    408410
    409 cat > call_param_replay.F90 <<eod
     411cat > call_param_replay.${f90} <<eod
    410412subroutine call_param_replay($klon,$klev)
    411413USE IOIPSL, ONLY : getin
     
    414416integer :: ifin,irec,it,rec_length_replay=0,replay_irec0=1,replay_nt=1000
    415417eod
    416 grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay.F90
     418grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay.${f90}
    417419# duplicating declaration for inout variables
    418420
    419421for var in $varinout0 ; do
    420     sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/ //g' -e 's/,intent(.*[nt])//' | sed -e 's/::.*$/, allocatable, save :: '$var'_Replay0/' | sed -e 's/'$klon'/:/' -e 's/'${klev}'+1/:/' -e 's/'${klev}'/:/' >> call_param_replay.F90
     422    sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/ //g' -e 's/,intent(.*[nt])//' | sed -e 's/::.*$/, allocatable, save :: '$var'_Replay0/' | sed -e 's/'$klon'/:/' -e 's/'${klev}'+1/:/' -e 's/'${klev}'/:/' >> call_param_replay.${f90}
    421423done
    422424# Initalisation, shared with dump_param1.sh
    423 dump_param_open "in" $varin0 >> call_param_replay.F90
     425dump_param_open "in" $varin0 >> call_param_replay.${f90}
    424426for var in $varinout0 ; do
    425     sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/intent(.*t)//' -e 's/^.*(/allocate('$var'_Replay0(/' -e 's/).*$/))/' >> call_param_replay.F90
     427    sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/intent(.*t)//' -e 's/^.*(/allocate('$var'_Replay0(/' -e 's/).*$/))/' >> call_param_replay.${f90}
    426428done
    427429
    428 cat >> call_param_replay.F90 <<eod
     430cat >> call_param_replay.${f90} <<eod
    429431call getin('replay_nt',replay_nt)
    430432call getin('replay_irec0',replay_irec0)
     
    440442eod
    441443
    442 block_Replay0 "it == 1"          _Replay0   ""       $varinout0 >> call_param_replay.F90
    443 block_Replay0 "replay_irec0 < 0" ""         _Replay0 $varinout0 >> call_param_replay.F90
    444 get_subroutine_arg $param $paramfile | sed -e 's/subroutine/   call/' >> call_param_replay.F90
    445 block_Replay0 "replay_irec0 < 0" _Replay0   ""       $varinout0 >> call_param_replay.F90
    446 cat >> call_param_replay.F90 <<eod
     444block_Replay0 "it == 1"          _Replay0   ""       $varinout0 >> call_param_replay.${f90}
     445block_Replay0 "replay_irec0 < 0" ""         _Replay0 $varinout0 >> call_param_replay.${f90}
     446get_subroutine_arg $param $paramfile | sed -e 's/subroutine/   call/' >> call_param_replay.${f90}
     447block_Replay0 "replay_irec0 < 0" _Replay0   ""       $varinout0 >> call_param_replay.${f90}
     448cat >> call_param_replay.${f90} <<eod
    447449enddo
    448450return
     
    508510
    509511if [ $nconly = false -a $param_ini != None ] ; then
    510    varinmod=`grep -i 'intent.in' $inimod.F90 | sed -e 's/\!.*$//' | cut -d: -f3 | sed -e 's/,/ /g'`
     512   varinmod=`grep -i 'intent.in' $inimod.${f90} | sed -e 's/\!.*$//' | cut -d: -f3 | sed -e 's/,/ /g'`
    511513   varinmodv=`echo $varinmod | sed -e 's/ /,/g'`
    512514   cat > $iniinc <<...eod...............................................
     
    516518...eod...............................................
    517519   for var_ in $varinmod ; do echo "print*,'Interface $param_ini $var_',$var_" >> $iniinc ; done
    518    include_line "include \"$iniinc\"" $param_ini $inimod.F90  -before_return
     520   include_line "include \"$iniinc\"" $param_ini $inimod.${f90}  -before_return
    519521fi # nconly = false
    520522
    521523#-----------------------------------------------------------------------------
    522 # call_ini_replay.F90 gere l'initialisation du module en mode replay
     524# call_ini_replay.${f90} gere l'initialisation du module en mode replay
    523525#-----------------------------------------------------------------------------
    524526if [ $nconly = false -a $param_ini != None ] ; then
    525     cat > call_ini_replay.F90 <<....eod............................................
     527    cat > call_ini_replay.${f90} <<....eod............................................
    526528    subroutine call_ini_replay
    527529    use $inimod
    528530    IMPLICIT NONE
    529531....eod............................................
    530     grep -i intent.in $inimod.F90  |  tr '[A-Z]' '[a-z]' | sed -e 's/,.*intent.i.*)//' >> call_ini_replay.F90
    531     cat >> call_ini_replay.F90 <<....eod...........................................
     532    grep -i intent.in $inimod.${f90}  |  tr '[A-Z]' '[a-z]' | sed -e 's/,.*intent.i.*)//' >> call_ini_replay.${f90}
     533    cat >> call_ini_replay.${f90} <<....eod...........................................
    532534    open(90,file='$inimod.bin',form='unformatted')
    533535    read(90) $varinmodv
    534536    close(90)
    535537....eod...........................................
    536     #get_subroutine_arg $param_ini $inimod.F90 ; exit
    537     get_subroutine_arg $param_ini $inimod.F90 | sed -e 's/subroutine/call/' >> call_ini_replay.F90
    538     cat >> call_ini_replay.F90 <<....eod...........................................
     538    #get_subroutine_arg $param_ini $inimod.${f90} ; exit
     539    get_subroutine_arg $param_ini $inimod.${f90} | sed -e 's/subroutine/call/' >> call_ini_replay.${f90}
     540    cat >> call_ini_replay.${f90} <<....eod...........................................
    539541    return
    540542    end
Note: See TracChangeset for help on using the changeset viewer.