- Timestamp:
- Jan 8, 2023, 1:45:44 PM (2 years ago)
- Location:
- BOL/Replay
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/Replay/replay_clean.sh
r4364 r4378 4 4 replay_comment="replay automatic include" 5 5 if [ $# = 0 ] ; then 6 \rm -f dump_replay*.h dump_param.h dump_ini.h call_param_repla y.F90 dump_ini_module.F90 get_ini_module.F90 input tmp tmp26 \rm -f dump_replay*.h dump_param.h dump_ini.h call_param_repla* get_ini_modul* input tmp tmp2 tmp3 tmp2_cpp 7 7 for file in `grep "$replay_comment" *F90 | cut -d: -f1` ; do 8 8 sed -i"" -e "/$replay_comment/d" $file -
BOL/Replay/replay_equip.sh
r4373 r4378 52 52 # * dump_param1.h : écriture de l'interface "in" de param (dump_param.bin fort.82) 53 53 # * dump_param2.h : écriture des sorties de la routines dans phys.nc 54 # * call_param_replay .F90: sous programme d'appelle en boucle à la param54 # * call_param_replay : sous programme d'appelle en boucle à la param 55 55 # * dump_ini_module.F90 : écriture de l'interface "in" de param_ini 56 # * get_ini_module .F90: lecture de l'interface "in" de param_ini56 # * get_ini_module : 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 … … 110 110 111 111 case $param in 112 vdif_k) paramini=None ; inimod=None ; klon=ngrid ; klev=nlay ;; 112 113 thermcell_main|thermcell_plume_6A|thermcell_env|thermcell_height|thermcell_dry|\ 113 114 thermcell_closure|thermcell_height|thermcell_dq|thermcell_flux2|thermcell_down| \ … … 309 310 if [ $nconly = false ] ; then 310 311 311 cat > call_param_replay .F90<<eod312 cat > call_param_replay <<eod 312 313 subroutine call_param_replay($klon,$klev) 313 314 USE IOIPSL, ONLY : getin … … 315 316 integer :: ifin,irec,it,rec_length_replay=0,replay_irec0=1,replay_nt=1000 316 317 eod 317 grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay .F90318 grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay 318 319 # duplicating declaration for inout variables 319 320 320 321 for 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 .F90322 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 322 323 done 323 324 # Initalisation, shared with dump_param1.sh 324 dump_param_open "in" $varin0 >> call_param_replay .F90325 dump_param_open "in" $varin0 >> call_param_replay 325 326 for 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 .F90327 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 327 328 done 328 329 329 cat >> call_param_replay .F90<<eod330 cat >> call_param_replay <<eod 330 331 call getin('replay_nt',replay_nt) 331 332 call getin('replay_irec0',replay_irec0) … … 341 342 eod 342 343 343 block_Replay0 "it == 1" _Replay0 "" $varinout0 >> call_param_replay .F90344 block_Replay0 "replay_irec0 < 0" "" _Replay0 $varinout0 >> call_param_replay .F90345 get_subroutine_arg $param $paramfile | sed -e 's/subroutine/ call/' >> call_param_replay .F90346 block_Replay0 "replay_irec0 < 0" _Replay0 "" $varinout0 >> call_param_replay .F90347 cat >> call_param_replay .F90<<eod344 block_Replay0 "it == 1" _Replay0 "" $varinout0 >> call_param_replay 345 block_Replay0 "replay_irec0 < 0" "" _Replay0 $varinout0 >> call_param_replay 346 get_subroutine_arg $param $paramfile | sed -e 's/subroutine/ call/' >> call_param_replay 347 block_Replay0 "replay_irec0 < 0" _Replay0 "" $varinout0 >> call_param_replay 348 cat >> call_param_replay <<eod 348 349 enddo 349 350 return … … 396 397 #----------------------------------------------------------------------------- 397 398 399 if [ $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 408 fi # nconly = false 409 410 411 #----------------------------------------------------------------------------- 412 # get_ini_module gere l'initialisation du module en mode replay 413 #----------------------------------------------------------------------------- 414 if [ $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........................................... 432 fi # nconly = false 433 434 #----------------------------------------------------------------------------- 435 # Inclusion de l'ecriture de l'interface de l'initialisation 436 #----------------------------------------------------------------------------- 437 398 438 if [ $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 442 fi 437 443 438 444 #\rm -f tmp input
Note: See TracChangeset
for help on using the changeset viewer.