Changeset 6051 for BOL


Ignore:
Timestamp:
Jan 23, 2026, 11:53:46 AM (37 hours ago)
Author:
fhourdin
Message:

Plein de petites corrections

Location:
BOL/Replay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BOL/Replay/replay_clean.sh

    r5459 r6051  
    77   \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*
    88
    9    for file in `grep "$replay_comment" *f90 *F90 | cut -d: -f1` ; do
     9   for file in `grep "$replay_comment" *f90 *F90 dyn1d/*.[hfF]* | cut -d: -f1` ; do
    1010      sed -i"" -e "/$replay_comment/d" $file
    1111   done
  • BOL/Replay/replay_equip.sh

    r6049 r6051  
    262262   line_subroutine=`cat $paramfile_ | tr '[A-Z]' '[a-z]' | sed -n -e "/subrou.*${name_min}.*(/=" | head -1 `
    263263   tail -n +$line_subroutine $paramfile_ > ${tmp} # file starting at the subroutine instruction
    264    line_return=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" ${tmp} | head -1`
     264   line_return=$( sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" ${tmp} | head -1 )
    265265   head -$line_return ${tmp} > ${tmp}2               # file containing the routine
    266266   sed -e 's/\!.*$//' ${tmp}2 > ${tmp}3
     
    279279         -after_declarations)      targeted_line=$line_last_declaration ;;
    280280         -before_return)           targeted_line=$line_return ;;
     281         -before_end)           targeted_line=$line_return ;;
    281282         -before_end_module)       targeted_line=$line_end_module ;;
    282283         -before_line|-after_line) linestr=`echo $1 | sed -e "s/$wtype //"` ; targeted_line=`sed -n -e "/$linestr/=" ${tmp}2` ;;
     
    417418# On nettoye les inclusions précédente dans les fichiers .f90
    418419if [ $nconly = false ] ; then
    419    for file in `grep "$replay_comment" *.[fF]90 2> /dev/null | cut -d: -f1` ; do
     420   for file in `grep "$replay_comment" *.[fF]90 dyn1d/1DUTILS.h 2> /dev/null | cut -d: -f1` ; do
    420421      sed -i"" -e "/$replay_comment/d" $file
    421422   done
     
    449450IMPLICIT NONE
    450451integer :: ifin,irec,it,rec_length_replay=0,replay_irec0=1,replay_nt=1000
    451 integer :: status,ncid,varid
     452integer :: status,ncid,varid,size_,nrec_,status_open_netcdf
    452453real*4,dimension($klon,$klev) :: v2d
    453454real*4,dimension($klon) :: v1d
     
    466467
    467468cat >> call_param_replay.f90 <<eod
     469
    468470call getin('replay_nt',replay_nt)
    469471call getin('replay_irec0',replay_irec0)
     472inquire(unit=82,size=size_) ; nrec_=size_/rec_length_replay
     473replay_nt=min(replay_nt,nrec_)
     474status_open_netcdf = nf90_open("replay_in.nc", nf90_nowrite, ncid)
     475
    470476do it=1,replay_nt
    471477   if (replay_irec0>=0) then
     
    477483   read(82,rec=irec,iostat=ifin) $varin
    478484   if (.NOT. ifin == 0 ) stop "Fin du fichier fort.82"
    479    status = nf90_open("replay_in.nc", nf90_nowrite, ncid)
    480    if (status == nf90_noerr) then
     485   if (status_open_netcdf == nf90_noerr) then
    481486eod
    482487
    483 for var in $var_2D_in $var_2D_inout ; do
    484    echo "status=nf90_inq_varid(ncid,\"$var\",varid)" >> call_param_replay.f90
    485    echo "status=nf90_get_var(ncid,varid,v2d,start=(/1,1,1,it/), count=(/1,1,$klev,it/))" >> call_param_replay.f90
    486    echo "$var(:,1:$klev)=v2d(:,1:$klev)"  >> call_param_replay.f90
     488# for var in $var_2D_in $var_2D_inout ; do
     489#    echo "status=nf90_inq_varid(ncid,\"$var\",varid)" >> call_param_replay.f90
     490#    echo "status=nf90_get_var(ncid,varid,v2d,start=(/1,1,1,it/), count=(/1,1,$klev,it/))" >> call_param_replay.f90
     491#    echo "$var(:,1:$klev)=v2d(:,1:$klev)"  >> call_param_replay.f90
     492# done
     493
     494var_lists_=( "$var_1D_in $var_1D_inout" "$var_2D_in $var_2D_inout" )
     495for idim in 1 2 ; do
     496   for var in ${var_lists_[$(($idim - 1))]} ; do
     497      if [ $idim == 1 ] ; then l0= ; llen= ; varf="$var(:)" ; else l0=,1 ; llen=,$klev ; varf="$var(:,1:$klev)" ; fi
     498      local_var=v${idim}d
     499      cat >> call_param_replay.f90 <<......eod
     500   
     501      status=nf90_inq_varid(ncid,"$var",varid)
     502      if (status /= nf90_noerr) then ; print*,"Reading $var",nf90_strerror(status) ; stop ; endif
     503      status=nf90_get_var(ncid, varid, $local_var, start=(/1,1$l0,it/), count=(/1,1$llen,1/))
     504      if (status /= nf90_noerr) then ; print*,"Reading $var",nf90_strerror(status) ; stop ; endif
     505      $varf=$local_var
     506......eod
    487507done
    488 
    489 for var in $var_1D_in $var_1D_inout ; do
    490    echo "status=nf90_inq_varid(ncid,\"$var\",varid)" >> call_param_replay.f90
    491    echo "status=nf90_get_var(ncid, varid, v1d, start=(/1,1,it/), count=(/1,1,it/))" >> call_param_replay.f90
    492    echo "$var=v1d"  >> call_param_replay.f90
    493508done
     509echo "endif" >>  call_param_replay.f90
    494510
    495511block_Replay0 "it == 1"          _Replay0   ""       $varinout0 >> call_param_replay.f90
     
    499515
    500516cat >> call_param_replay.f90 <<eod
    501    end if
    502517enddo
     518call iotd_fin
    503519return
    504520end subroutine call_param_replay
     
    621637create_dump_param_nc
    622638
     639# For proper closing of phys.nc
     640include_line "CALL iotd_fin" dyn1dredem  dyn1d/1DUTILS.h -before_return
     641
    623642# Some cleaning
    624643\rm -f input tmp_get* tmp_include* tmpline*
     644
Note: See TracChangeset for help on using the changeset viewer.