Changeset 4378


Ignore:
Timestamp:
Jan 8, 2023, 1:45:44 PM (16 months ago)
Author:
fhourdin
Message:

Modification pour eviter la recompilation

Location:
BOL/Replay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BOL/Replay/replay_clean.sh

    r4364 r4378  
    44replay_comment="replay automatic include"
    55if [ $# = 0 ] ; then
    6    \rm -f dump_replay*.h dump_param.h dump_ini.h call_param_replay.F90 dump_ini_module.F90 get_ini_module.F90 input tmp tmp2
     6   \rm -f dump_replay*.h dump_param.h dump_ini.h call_param_repla* get_ini_modul* input tmp tmp2 tmp3 tmp2_cpp
    77   for file in `grep "$replay_comment" *F90 | cut -d: -f1` ; do
    88      sed -i"" -e "/$replay_comment/d" $file
  • BOL/Replay/replay_equip.sh

    r4373 r4378  
    5252#  * dump_param1.h          : écriture de l'interface "in" de param (dump_param.bin fort.82)
    5353#  * dump_param2.h          : écriture des sorties de la routines dans phys.nc
    54 #  * call_param_replay.F90 : sous programme d'appelle en boucle à la param
     54#  * call_param_replay : sous programme d'appelle en boucle à la param
    5555#  * dump_ini_module.F90   : écriture de l'interface "in" de param_ini
    56 #  * get_ini_module.F90    : lecture de l'interface "in" de param_ini
     56#  * get_ini_module    : 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
     
    110110
    111111case $param in
     112   vdif_k) paramini=None ; inimod=None ; klon=ngrid ; klev=nlay ;;
    112113   thermcell_main|thermcell_plume_6A|thermcell_env|thermcell_height|thermcell_dry|\
    113114      thermcell_closure|thermcell_height|thermcell_dq|thermcell_flux2|thermcell_down| \
     
    309310if [ $nconly = false ] ; then
    310311
    311 cat > call_param_replay.F90 <<eod
     312cat > call_param_replay <<eod
    312313subroutine call_param_replay($klon,$klev)
    313314USE IOIPSL, ONLY : getin
     
    315316integer :: ifin,irec,it,rec_length_replay=0,replay_irec0=1,replay_nt=1000
    316317eod
    317 grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay.F90
     318grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay
    318319# duplicating declaration for inout variables
    319320
    320321for var in $varinout0 ; do
    321     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'/:/' >> call_param_replay.F90
     322    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'/:/' >> call_param_replay
    322323done
    323324# Initalisation, shared with dump_param1.sh
    324 dump_param_open "in" $varin0 >> call_param_replay.F90
     325dump_param_open "in" $varin0 >> call_param_replay
    325326for var in $varinout0 ; do
    326     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
     327    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
    327328done
    328329
    329 cat >> call_param_replay.F90 <<eod
     330cat >> call_param_replay <<eod
    330331call getin('replay_nt',replay_nt)
    331332call getin('replay_irec0',replay_irec0)
     
    341342eod
    342343
    343 block_Replay0 "it == 1"          _Replay0   ""       $varinout0 >> call_param_replay.F90
    344 block_Replay0 "replay_irec0 < 0" ""         _Replay0 $varinout0 >> call_param_replay.F90
    345 get_subroutine_arg $param $paramfile | sed -e 's/subroutine/   call/' >> call_param_replay.F90
    346 block_Replay0 "replay_irec0 < 0" _Replay0   ""       $varinout0 >> call_param_replay.F90
    347 cat >> call_param_replay.F90 <<eod
     344block_Replay0 "it == 1"          _Replay0   ""       $varinout0 >> call_param_replay
     345block_Replay0 "replay_irec0 < 0" ""         _Replay0 $varinout0 >> call_param_replay
     346get_subroutine_arg $param $paramfile | sed -e 's/subroutine/   call/' >> call_param_replay
     347block_Replay0 "replay_irec0 < 0" _Replay0   ""       $varinout0 >> call_param_replay
     348cat >> call_param_replay <<eod
    348349enddo
    349350return
     
    396397#-----------------------------------------------------------------------------
    397398
     399if [ $nconly = false -a $paramini != None ] ; then
     400   varinmod=`grep -i 'intent.in' $inimod.F90 | sed -e 's/\!.*$//' | cut -d: -f3 | sed -e 's/,/ /g'`
     401   varinmodv=`echo $varinmod | sed -e 's/ /,/g'`
     402   cat > $iniinc <<...eod...............................................
     403   open(90,file='$inimod.bin',form='unformatted')
     404   write(90) $varinmodv
     405   close(90)
     406...eod...............................................
     407   include_line "include \"$iniinc\"" $paramini $inimod.F90  -before_return
     408fi # nconly = false
     409
     410
     411#-----------------------------------------------------------------------------
     412# get_ini_module gere l'initialisation du module en mode replay
     413#-----------------------------------------------------------------------------
     414if [ $nconly = false -a $paramini != None ] ; then
     415    cat > get_ini_module <<....eod............................................
     416    subroutine get_ini_module
     417    use $inimod
     418    IMPLICIT NONE
     419....eod............................................
     420    grep -i intent.in $inimod.F90  |  tr '[A-Z]' '[a-z]' | sed -e 's/,.*intent.i.*)//' >> get_ini_module
     421    cat >> get_ini_module <<....eod...........................................
     422    open(90,file='$inimod.bin',form='unformatted')
     423    read(90) $varinmodv
     424    close(90)
     425....eod...........................................
     426    #get_subroutine_arg $paramini $inimod.F90 ; exit
     427    get_subroutine_arg $paramini $inimod.F90 | sed -e 's/subroutine/call/' >> get_ini_module
     428    cat >> get_ini_module <<....eod...........................................
     429    return
     430    end
     431....eod...........................................
     432fi # nconly = false
     433
     434#-----------------------------------------------------------------------------
     435# Inclusion de l'ecriture de l'interface de l'initialisation
     436#-----------------------------------------------------------------------------
     437
    398438if [ $nconly = false ] ; then
    399 varinmod=`grep -i 'intent.in' $inimod.F90 | sed -e 's/\!.*$//' | cut -d: -f3 | sed -e 's/,/ /g'`
    400 varinmodv=`echo $varinmod | sed -e 's/ /,/g'`
    401 cat > $iniinc <<eod
    402 open(90,file='$inimod.bin',form='unformatted')
    403 write(90) $varinmodv
    404 close(90)
    405 eod
    406 include_line "include \"$iniinc\"" $paramini $inimod.F90  -before_return
    407 fi # nconly = false
    408 
    409 
    410 #-----------------------------------------------------------------------------
    411 # get_ini_module gere l'initialisation du module en mode replay
    412 #-----------------------------------------------------------------------------
    413 if [ $nconly = false ] ; then
    414 cat > get_ini_module.F90 <<eod
    415 subroutine get_ini_module
    416 use $inimod
    417 IMPLICIT NONE
    418 eod
    419 grep -i intent.in $inimod.F90  |  tr '[A-Z]' '[a-z]' | sed -e 's/,.*intent.i.*)//' >> get_ini_module.F90
    420 cat >> get_ini_module.F90 <<eod
    421 open(90,file='$inimod.bin',form='unformatted')
    422 read(90) $varinmodv
    423 close(90)
    424 eod
    425 #get_subroutine_arg $paramini $inimod.F90 ; exit
    426 get_subroutine_arg $paramini $inimod.F90 | sed -e 's/subroutine/call/' >> get_ini_module.F90
    427 cat >> get_ini_module.F90 <<eod
    428 return
    429 end
    430 eod
    431 fi # nconly = false
    432 
    433 #-----------------------------------------------------------------------------
    434 # Inclusion de l'ecriture de l'interface de l'initialisation
    435 #-----------------------------------------------------------------------------
    436 
     439     for file in get_ini_module call_param_replay ; do sed -i'' -e "s/$/                                        \!$replay_comment/"  $file ; done
     440     cat get_ini_module >> $inimod.F90
     441     cat call_param_replay >> $paramfile
     442fi
    437443
    438444#\rm -f tmp input
Note: See TracChangeset for help on using the changeset viewer.