Changeset 2399 for trunk


Ignore:
Timestamp:
Jul 6, 2020, 2:57:50 PM (4 years ago)
Author:
emillour
Message:

Mars GCM:
More code cleanup: use "call abort_physic()" instead of "stop" or "call abort"
EM

Location:
trunk/LMDZ.MARS/libf/phymars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F

    r2332 r2399  
    448448               PRINT*,'Ps = ',pplev(ig,1)
    449449               PRINT*,'d Ps = ',pdpsrf(ig)
    450                STOP
     450               CALL abort_physic('co2condens',
     451     &              'condensing more than total mass', 1)
    451452            ENDIF
    452453         END IF ! if there is condensation/sublimation
     
    806807                w(l+1) = Mtot
    807808                qm(l+1) = Mqtot / Mtot
    808                 write(*,*) 'top layer is disapearing !'
    809                 stop
     809                CALL abort_physic('co2condens',
     810     &               'top layer is disapearing !', 1)
    810811             end if
    811812          else      ! if(w(l+1).lt.0)
  • trunk/LMDZ.MARS/libf/phymars/def_var.F90

    r38 r2399  
    1313implicit none
    1414
    15 #include "netcdf.inc"
     15include "netcdf.inc"
    1616
    1717integer,intent(in) :: nid ! NetCDF file ID
     
    3737   write(*,*) "def_var: Failed defining variable "//trim(name)
    3838   write(*,*) NF_STRERROR(ierr)
    39    stop ""
     39   call abort_physic("def_var",'netcdf definition problem',1)
    4040endif
    4141
     
    4646   write(*,*) "def_var: Failed writing title attribute for "//trim(name)
    4747   write(*,*) NF_STRERROR(ierr)
    48    stop ""
     48   call abort_physic("def_var",'netcdf title attribute problem',1)
    4949endif
    5050
     
    5454   write(*,*) "def_var: Failed writing units attribute for "//trim(name)
    5555   write(*,*) NF_STRERROR(ierr)
    56    stop ""
     56   call abort_physic("def_var",'netcdf units attribute problem',1)
    5757endif
    5858
  • trunk/LMDZ.MARS/libf/phymars/getslopes.F90

    r1543 r2399  
    2929  ! This routine only works in serial mode so stop now.
    3030  write(*,*) "getslopes Error: this routine is not designed to run in parallel"
    31   stop
     31  call abort_physic("getslopes",'cannot be run in parallel',1)
    3232endif
    3333
  • trunk/LMDZ.MARS/libf/phymars/inistats.F

    r1621 r2399  
    3838      nsteppd=nint(daysec/dtphys)
    3939      write (*,*) 'nsteppd=',nsteppd
    40       if (abs(float(nsteppd)-daysec/dtphys).gt.1.e-8*daysec)
    41      &   stop'Dans Instat:  1jour .ne. n pas physiques'
     40      if (abs(float(nsteppd)-daysec/dtphys).gt.1.e-8*daysec) then
     41        call abort_physic("inistats",
     42     &                    '1 sol .ne. n physics steps',1)
     43      endif
    4244
    43       if(mod(nsteppd,istime).ne.0)
    44      &   stop'Dans Instat:  1jour .ne. n*istime pas physiques'
     45      if(mod(nsteppd,istime).ne.0) then
     46        call abort_physic("inistats",
     47     &                    '1 sol .ne. n*istime physics steps',1)
     48      endif
    4549
    4650      istats=nsteppd/istime
     
    6872      if (ierr.ne.NF_NOERR) then
    6973         write (*,*) NF_STRERROR(ierr)
    70          stop ""
     74        call abort_physic("inistats",
     75     &                    'failed creating stats.nc',1)
    7176      endif
    7277
  • trunk/LMDZ.MARS/libf/phymars/iostart.F90

    r1621 r2399  
    5353        write(*,*)'open_startphy: problem opening file '//trim(filename)
    5454        write(*,*)trim(nf90_strerror(ierr))
    55         CALL ABORT
     55        CALL abort_physic("open_startphy","Cannot open file",1)
    5656      ENDIF
    5757    ENDIF
     
    117117                  //trim(field_name)
    118118        write(*,*)trim(nf90_strerror(ierr))
    119         CALL ABORT
     119        CALL abort_physic("inquire_field_ndims","Failed to get ndims",1)
    120120      ENDIF
    121121    ENDIF
     
    168168                  //trim(field_name)
    169169        write(*,*)trim(nf90_strerror(ierr))
    170         CALL ABORT
     170        CALL abort_physic("inquire_field_ndims","Failed to get length",1)
    171171      ENDIF
    172172    ENDIF
     
    307307      IF (.NOT. tmp_found) THEN
    308308        PRINT*, 'get_field_rgen: Field <'//field_name//'> not found'
    309         CALL abort
     309        CALL abort_physic("get_field_rgen","Failed to get field",1)
    310310      ENDIF
    311311    ENDIF
     
    332332!              END IF
    333333!           ELSE
    334               CALL abort
     334              CALL abort_physic("get_field_rgen","Failed to read field",1)
    335335!           ENDIF
    336336         ENDIF
     
    427427        IF (ierr/=NF90_NOERR) THEN
    428428          PRINT*, 'phyetat0: Failed loading <'//trim(var_name)//'>'
    429           CALL abort
     429          CALL abort_physic("get_var_rgen","Failed to read variable",1)
    430430        ENDIF
    431431        tmp_found=.TRUE.
     
    447447      IF (.NOT. tmp_found) THEN
    448448        PRINT*, 'phyetat0: Variable <'//trim(var_name)//'> not found'
    449         CALL abort
     449        CALL abort_physic("get_var_rgen","Failed to read variable",1)
    450450      ENDIF
    451451    ENDIF
     
    479479          write(*,*)'open_restartphy: problem creating file '//trim(filename)
    480480          write(*,*)trim(nf90_strerror(ierr))
    481           CALL ABORT
     481          CALL abort_physic("open_restartphy","Failed creating file",1)
    482482        ENDIF
    483483        already_created=.true.
     
    488488          write(*,*)'open_restartphy: problem opening file '//trim(filename)
    489489          write(*,*)trim(nf90_strerror(ierr))
    490           CALL ABORT
     490          CALL abort_physic("open_restartphy","Failed opening file",1)
    491491        ENDIF
    492492        return
     
    504504        write(*,*)'open_restartphy: problem defining index dimension '
    505505        write(*,*)trim(nf90_strerror(ierr))
    506         CALL ABORT
     506        CALL abort_physic("open_restartphy","Failed defining index",1)
    507507      ENDIF
    508508     
     
    511511        write(*,*)'open_restartphy: problem defining physical_points dimension '
    512512        write(*,*)trim(nf90_strerror(ierr))
    513         CALL ABORT
     513        CALL abort_physic("open_restartphy","Failed defining physical_points",1)
    514514      ENDIF
    515515     
     
    518518        write(*,*)'open_restartphy: problem defining subsurface_layers dimension '
    519519        write(*,*)trim(nf90_strerror(ierr))
    520         CALL ABORT
     520        CALL abort_physic("open_restartphy","Failed defining subsurface_layers",1)
    521521      ENDIF
    522522     
     
    525525        write(*,*)'open_restartphy: problem defining nlayer_plus_1 dimension '
    526526        write(*,*)trim(nf90_strerror(ierr))
    527         CALL ABORT
     527        CALL abort_physic("open_restartphy","Failed defining nlayer_plus_1",1)
    528528      ENDIF
    529529     
     
    537537        write(*,*)'open_restartphy: problem defining number_of_advected_fields dimension '
    538538        write(*,*)trim(nf90_strerror(ierr))
    539         CALL ABORT
     539        CALL abort_physic("open_restartphy","Failed defining number_of_advected_fields",1)
    540540      ENDIF
    541541
     
    544544        write(*,*)'open_restartphy: problem defining nlayer dimension '
    545545        write(*,*)trim(nf90_strerror(ierr))
    546         CALL ABORT
     546        CALL abort_physic("open_restartphy","Failed defining nlayer",1)
    547547      ENDIF
    548548     
     
    551551        write(*,*)'open_restartphy: problem defining Time dimension '
    552552        write(*,*)trim(nf90_strerror(ierr))
    553         CALL ABORT
     553        CALL abort_physic("open_restartphy","Failed defining Time",1)
    554554      ENDIF
    555555
     
    558558        write(*,*)'open_restartphy: problem ending definition mode '
    559559        write(*,*)trim(nf90_strerror(ierr))
    560         CALL ABORT
     560        CALL abort_physic("open_restartphy","Failed ending definition mode",1)
    561561      ENDIF
    562562    ENDIF
     
    822822        PRINT *, "Error phyredem(put_field_rgen) : wrong dimension for ",trim(field_name)
    823823        write(*,*) "  field_size =",field_size
    824         CALL ABORT
     824        CALL abort_physic("put_field_rgen","wrong field dimension",1)
    825825      ENDIF
    826826
     
    829829        write(*,*) " Error phyredem(put_field_rgen) : failed writing ",trim(field_name)
    830830        write(*,*)trim(nf90_strerror(ierr))
    831         call abort
     831        CALL abort_physic("put_field_rgen","Failed writing field",1)
    832832      endif
    833833
     
    932932          write(*,*)'put_var_rgen: problem writing Time'
    933933          write(*,*)trim(nf90_strerror(ierr))
    934           CALL ABORT
     934          CALL abort_physic("get_var_rgen","Failed to write Time",1)
    935935        ENDIF
    936936        return ! nothing left to do
     
    944944        PRINT *, "put_var_rgen error : wrong dimension"
    945945        write(*,*) "  var_size =",var_size
    946         CALL abort
     946        CALL abort_physic("get_var_rgen","Wrong variable dimension",1)
    947947
    948948      ENDIF ! of IF (var_size==length) THEN
     
    965965        write(*,*)'put_var_rgen: problem writing '//trim(var_name)
    966966        write(*,*)trim(nf90_strerror(ierr))
    967         CALL ABORT
     967        CALL abort_physic("get_var_rgen","Failed writing variable",1)
    968968      ENDIF
    969969    ENDIF ! of IF (is_master)
  • trunk/LMDZ.MARS/libf/phymars/nonoro_gwd_ran_mod.F90

    r2266 r2399  
    469469       end DO
    470470       CLOSE(11)
    471        stop
     471       CALL abort_physic("nonoro_gwd_ran","stop here, the work is done",0)
    472472    endif
    473473
Note: See TracChangeset for help on using the changeset viewer.