Changeset 5442
- Timestamp:
- Dec 21, 2024, 12:10:58 PM (9 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/Replay/replay_equip.sh
r5038 r5442 53 53 # * dump_param2.h : écriture des sorties de la routines dans phys.nc 54 54 # * call_param_replay : sous programme d'appelle en boucle à la param 55 # * dump_ini_module. F90: écriture de l'interface "in" de param_ini56 # * call_ini_replay. F90: lecture de l'interface "in" de param_ini55 # * 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 57 57 # dans ${param_ini}_mod.bin. 58 58 # Par ailleurs, un programme replay1d a été ajouté dans phylmd/dyn1d 59 59 # qui appelle call_param_replay 60 60 # Le script ajoute par ailleurs quelques lignes dans ${paramfile} et 61 # ${param_ini}. F9061 # ${param_ini}.${f90} 62 62 # replay_clean.sh élimine toutes les lignes ajoutées 63 63 # … … 73 73 # 74 74 #============================================================================= 75 76 f90=f90 75 77 76 78 #----------------------------------------------------------------------------- … … 108 110 -ncvars) ncvars="`echo $2 | sed -e 's/,/ /g'`" ; shift ; shift ;; 109 111 -lonlat) lonlat=$2 ; shift ; shift ;; 110 *) if (( $# > 1 )) ; then $0 -h ; exit ; fi ; param=`basename $1 . F90` ; shift112 *) if (( $# > 1 )) ; then $0 -h ; exit ; fi ; param=`basename $1 .${f90}` ; shift 111 113 esac 112 114 done … … 129 131 paraminc2=dump_replay_${param}_nc_${prefix}.h 130 132 iniinc=dump_replay_ini.h 131 paramfile=`grep -i "subro.* ${param}[\ (]" *. F90| sed -e 's/ //g' | grep "${param}(" | cut -d: -f1`133 paramfile=`grep -i "subro.* ${param}[\ (]" *.${f90} | sed -e 's/ //g' | grep "${param}(" | cut -d: -f1` 132 134 echo =================================================================================== 133 135 echo Equiping $param contained in file $paramfile … … 339 341 340 342 #----------------------------------------------------------------------------- 341 # On nettoye les inclusions précédente dans les fichiers . F90343 # On nettoye les inclusions précédente dans les fichiers .${f90} 342 344 #----------------------------------------------------------------------------- 343 345 344 346 if [ $nconly = false ] ; then 345 for file in `grep "$replay_comment" *. F902> /dev/null | cut -d: -f1` ; do347 for file in `grep "$replay_comment" *.${f90} 2> /dev/null | cut -d: -f1` ; do 346 348 sed -i"" -e "/$replay_comment/d" $file 347 349 done … … 407 409 if [ $nconly = false ] ; then 408 410 409 cat > call_param_replay. F90<<eod411 cat > call_param_replay.${f90} <<eod 410 412 subroutine call_param_replay($klon,$klev) 411 413 USE IOIPSL, ONLY : getin … … 414 416 integer :: ifin,irec,it,rec_length_replay=0,replay_irec0=1,replay_nt=1000 415 417 eod 416 grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay. F90418 grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay.${f90} 417 419 # duplicating declaration for inout variables 418 420 419 421 for 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. F90422 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} 421 423 done 422 424 # Initalisation, shared with dump_param1.sh 423 dump_param_open "in" $varin0 >> call_param_replay. F90425 dump_param_open "in" $varin0 >> call_param_replay.${f90} 424 426 for 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. F90427 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} 426 428 done 427 429 428 cat >> call_param_replay. F90<<eod430 cat >> call_param_replay.${f90} <<eod 429 431 call getin('replay_nt',replay_nt) 430 432 call getin('replay_irec0',replay_irec0) … … 440 442 eod 441 443 442 block_Replay0 "it == 1" _Replay0 "" $varinout0 >> call_param_replay. F90443 block_Replay0 "replay_irec0 < 0" "" _Replay0 $varinout0 >> call_param_replay. F90444 get_subroutine_arg $param $paramfile | sed -e 's/subroutine/ call/' >> call_param_replay. F90445 block_Replay0 "replay_irec0 < 0" _Replay0 "" $varinout0 >> call_param_replay. F90446 cat >> call_param_replay. F90<<eod444 block_Replay0 "it == 1" _Replay0 "" $varinout0 >> call_param_replay.${f90} 445 block_Replay0 "replay_irec0 < 0" "" _Replay0 $varinout0 >> call_param_replay.${f90} 446 get_subroutine_arg $param $paramfile | sed -e 's/subroutine/ call/' >> call_param_replay.${f90} 447 block_Replay0 "replay_irec0 < 0" _Replay0 "" $varinout0 >> call_param_replay.${f90} 448 cat >> call_param_replay.${f90} <<eod 447 449 enddo 448 450 return … … 508 510 509 511 if [ $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'` 511 513 varinmodv=`echo $varinmod | sed -e 's/ /,/g'` 512 514 cat > $iniinc <<...eod............................................... … … 516 518 ...eod............................................... 517 519 for var_ in $varinmod ; do echo "print*,'Interface $param_ini $var_',$var_" >> $iniinc ; done 518 include_line "include \"$iniinc\"" $param_ini $inimod. F90-before_return520 include_line "include \"$iniinc\"" $param_ini $inimod.${f90} -before_return 519 521 fi # nconly = false 520 522 521 523 #----------------------------------------------------------------------------- 522 # call_ini_replay. F90gere l'initialisation du module en mode replay524 # call_ini_replay.${f90} gere l'initialisation du module en mode replay 523 525 #----------------------------------------------------------------------------- 524 526 if [ $nconly = false -a $param_ini != None ] ; then 525 cat > call_ini_replay. F90<<....eod............................................527 cat > call_ini_replay.${f90} <<....eod............................................ 526 528 subroutine call_ini_replay 527 529 use $inimod 528 530 IMPLICIT NONE 529 531 ....eod............................................ 530 grep -i intent.in $inimod. F90 | tr '[A-Z]' '[a-z]' | sed -e 's/,.*intent.i.*)//' >> call_ini_replay.F90531 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........................................... 532 534 open(90,file='$inimod.bin',form='unformatted') 533 535 read(90) $varinmodv 534 536 close(90) 535 537 ....eod........................................... 536 #get_subroutine_arg $param_ini $inimod. F90; exit537 get_subroutine_arg $param_ini $inimod. F90 | sed -e 's/subroutine/call/' >> call_ini_replay.F90538 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........................................... 539 541 return 540 542 end
Note: See TracChangeset
for help on using the changeset viewer.