Changeset 2398 for trunk


Ignore:
Timestamp:
Jul 6, 2020, 11:31:11 AM (4 years ago)
Author:
emillour
Message:

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

Location:
trunk/LMDZ.MARS
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r2397 r2398  
    31183118nirco2abs: handle the (rare) case when input O mixing ratio is negative to avoid
    31193119generating NaN heating rates.
     3120
     3121== 06/07/2020 == EM
     3122Some code cleanup: use "call abort_physic()" instead of "stop" or "call abort"
  • trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F

    r1775 r2398  
    2727c     =============================================================
    2828
    29 #include "callkeys.h"
     29      include "callkeys.h"
    3030
    3131c     Local variables
     
    544544                  WRITE(*,*)"Risk of division by 0 (aeroptproperties.F)"
    545545                  WRITE(*,*)"Check the size of the interpolation grid."
    546                   CALL ABORT
     546                  CALL abort_physic("aeroptproperties",
     547     &                              "Risk of division by 0",1)
    547548                ENDIF
    548549                IF (idomain.EQ.1) THEN ! VISIBLE DOMAIN -----------
     
    936937                  WRITE(*,*)"Risk of division by 0 (aeroptproperties.F)"
    937938                  WRITE(*,*)"Check the size of the interpolation grid."
    938                   CALL ABORT
     939                  CALL abort_physic("aeroptproperties",
     940     &                              "Risk of division by 0",1)
    939941                ENDIF
    940942                IF (idomain.EQ.1) THEN ! VISIBLE DOMAIN -----------
  • trunk/LMDZ.MARS/libf/phymars/callradite_mod.F

    r2252 r2398  
    375375             write(*,*)'      ',iaer,' ',trim(name_iaer(iaer))
    376376           enddo
    377            stop
     377           call abort_physic("callradite","incoherent scatterers",1)
    378378         else
    379379           write(*,*) "callradite: found all scatterers, namely:"
  • trunk/LMDZ.MARS/libf/phymars/conf_phys.F

    r2312 r2398  
    632632         if (hdo.and..not.water) then
    633633           print*,'if hdo is used, water should be used too'
    634            stop
     634           call abort_physic(modname,
     635     &          "hd2 requires tracer",1)
    635636         endif
    636637
  • trunk/LMDZ.MARS/libf/phymars/eofdump_mod.F90

    r2022 r2398  
    106106!
    107107      ieofs=nint(daysec/dtphys)
    108       if (abs(float(ieofs)-daysec/dtphys).gt.1.e-8*daysec) &
    109          stop 'In ineofdump:  1 day .ne. n physics timesteps'
     108      if (abs(float(ieofs)-daysec/dtphys).gt.1.e-8*daysec) then
     109         call abort_physic("ineofdump",' 1 day .ne. n physics timesteps',1)
     110      endif
    110111!
    111112!     Header
     
    118119        do j=1+eofskip/2,nbp_lat,eofskip   
    119120          ig = 1+ (j-2)*nbp_lon +i
    120           if(j.eq.1) stop 'Problem in ineofdump.F'
    121           if(j.eq.nbp_lat) stop 'Problem in ineofdump.F'
     121          if(j.eq.1) then
     122            call abort_physic("ineofdump",'Error: j==1',1)
     123          endif
     124          if(j.eq.nbp_lat) then
     125            call abort_physic("ineofdump",'Error: j==nbp_lat',1)
     126          endif
    122127#ifdef NC_DOUBLE
    123128          write(uehead,*) real(longitude(ig)*180./pi),real(latitude(ig)*180./pi)
  • trunk/LMDZ.MARS/libf/phymars/initracer.F

    r2324 r2398  
    431431      if (hdo) then
    432432        if (igcm_h2o_vap.gt.igcm_hdo_vap) then
    433            write(*,*) "Tracer H2O must be initialized before HDO"
    434            STOP
     433           call abort_physic("initracer",
     434     &          "Tracer H2O must be initialized before HDO",1)
    435435        else if ((nqfils(igcm_h2o_ice).lt.1)
    436436     &             .or. (nqfils(igcm_h2o_vap).lt.1)) then
    437437           write(*,*) "HDO must be transported as a son",
    438438     &                " of H2O: complete traceur.def"
    439            STOP
     439           call abort_physic("initracer","adapt your tracer.def",1)
    440440        else if ((igcm_hdo_ice.lt.nq-2)
    441441     &             .or. (igcm_hdo_vap.lt.nq-2)) then
    442442           write(*,*) "The isotopes (HDO) must be placed at",
    443443     &                " the end of the list in traceur.def"
    444            STOP
     444           call abort_physic("initracer","adapt your tracer.def",1)
    445445        endif
    446446      endif
     
    753753           write(*,*) "  cannot use hdo option without ",
    754754     &                "an hdo_vap tracer !"
    755            stop
     755           call abort_physic("initracer","hdo cycle issue",1)
    756756         endif
    757757         if (igcm_hdo_ice.eq.0) then
     
    759759           write(*,*) "  cannot use hdo option without ",
    760760     &                "an hdo_ice tracer !"
    761            stop
     761           call abort_physic("initracer","hdo cycle issue",1)
    762762         endif
    763763       endif
  • trunk/LMDZ.MARS/libf/phymars/nirco2abs.F

    r2397 r2398  
    8787
    8888c     parameters for CO2 heating fit
    89       real n_a, n_p0, n_b
    90       parameter (n_a=1.1956475)
    91       parameter (n_b=1.9628251)
    92       parameter (n_p0=0.0015888279)
     89      real,parameter :: n_a=1.1956475
     90      real,parameter :: n_p0=0.0015888279
     91      real,parameter :: n_b=1.9628251
    9392
    9493c     Variables added to implement NLTE correction factor (feb 2011)
     
    110109            write(*,*) "nirco2abs error: I need a CO2 tracer"
    111110            write(*,*) "     when running with nircorr==1"
    112             stop
     111            call abort_physic("nirco2abs","need a CO2 tracer",1)
    113112          endif
    114113          io=igcm_o
     
    116115            write(*,*) "nirco2abs error: I need an O tracer"
    117116            write(*,*) "     when running with nircorr==1"
    118             stop
     117            call abort_physic("nirco2abs","need an O tracer",1)
    119118          endif
    120119        endif
  • trunk/LMDZ.MARS/libf/phymars/nlte_aux.F

    r2151 r2398  
    227227     @           thist(1),thist(nhist)
    228228            write (*,*) ' HUNT/ location in grid:', xtemp(k)
    229             stop ' INTERSHP/ Interpolation error. T out of Histogram.'
     229            call abort_physic("intershphunt",
     230     &      'INTERSHP/ Interpolation error. T out of Histogram.',1)
    230231         endif
    231232         factor = 1.d0 /  (thist(i+1)-thist(i))
     
    286287     $           thist(1),thist(nhist)
    287288            write(*,*)'HUNT/ location in grid:',xtemp(k)
    288             stop'INTERSTR/1/ Interpolation error. T out of Histogram.'
     289            call abort_physic("interstrhunt",
     290     &      'INTERSTR/1/ Interpolation error. T out of Histogram.',1)
    289291         endif
    290292         factor = 1.d0 /  (thist(i+1)-thist(i))
     
    315317     @        thist(1),thist(nhist)
    316318         write (*,*) ' HUNT/ location in grid:', ts
    317          stop ' INTERSTR/2/ Interpolat error. T out of Histogram.'
     319         call abort_physic("interstrhunt",
     320     &   'INTERSTR/2/ Interpolat error. T out of Histogram.',1)
    318321      endif
    319322      factor = 1.d0 /  (thist(i+1)-thist(i))
     
    472475       write (*,*) ' Subroutine WE/ Error in Voift EQS calculation'
    473476       write (*,*) '  WL, WD, X, Y = ', wl, wd, x, y
    474        stop '  ERROR : Imaginary EQW. Revise spectral data. '
     477       call abort_physic("we_clean",
     478     &      'ERROR : Imaginary EQW. Revise spectral data. ',1)
    475479      endif
    476480
     
    932936         write (*,*) 'from d interp: new variable out of limits'
    933937         write (*,*) zzmin,'must be .ge. ',zmin
    934          stop
    935 !     elseif(zzmax.gt.zmax)then
    936 !     type *,'from interp: new variable out of limits'
    937 !     type *,zzmax, 'must be .le. ',zmax
    938 !     stop
     938         call abort_physic("interdp_limits","variable out of limits",1)
    939939      end if
    940940
     
    10271027            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    10281028            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1029             stop ' interhunt2/ Interpolat error. zz out of limits.'
     1029            call abort_physic("interhunt2veces",
     1030     &      'interhunt2/ Interpolat error. zz out of limits.',1)
    10301031         endif
    10311032
     
    10901091            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    10911092            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1092             stop ' interhunt5/ Interpolat error. zz out of limits.'
     1093            call abort_physic("interhunt5veces",
     1094     &      'interhunt5/ Interpolat error. zz out of limits.',1)
    10931095         endif
    10941096
     
    11581160            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    11591161            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1160             stop ' INTERHUNTDP3/ Interpolat error. zz out of limits.'
     1162            call abort_physic("interhuntdp3veces",
     1163     &      'INTERHUNTDP3/ Interpolat error. zz out of limits.',1)
    11611164         endif
    11621165
     
    12241227            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    12251228            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1226             stop ' INTERHUNTDP4/ Interpolat error. zz out of limits.'
     1229            call abort_physic("interhuntdp4veces",
     1230     &      'INTERHUNTDP4/ Interpolat error. zz out of limits.',1)
    12271231         endif
    12281232
     
    12921296            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    12931297            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1294             stop ' INTERHUNT/ Interpolat error. zz out of limits.'
     1298            call abort_physic("interhuntdp",
     1299     &      'INTERHUNT/ Interpolat error. zz out of limits.',1)
    12951300         endif
    12961301
     
    13541359            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    13551360            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1356             stop ' interhunt/ Interpolat error. z out of limits.'
     1361            call abort_physic("interhunt",
     1362     &      'interhunt/ Interpolat error. z out of limits.',1)
    13571363         endif
    13581364
     
    14321438            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    14331439            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1434             stop ' interhuntlimits/ Interpolat error. z out of limits.'
     1440            call abort_physic("interhuntlimits2veces",
     1441     &      'interhuntlimits/ Interpolat error. z out of limits.',1)
    14351442         endif
    14361443
     
    15221529            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    15231530            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1524             stop ' interhuntlimits/ Interpolat error. z out of limits.'
     1531            call abort_physic("interhuntlimits5veces",
     1532     &      'interhuntlimits/ Interpolat error. z out of limits.',1)
    15251533         endif
    15261534
     
    16221630            write (*,*) ' HUNT/ Limits input grid:', z(1),z(n)
    16231631            write (*,*) ' HUNT/ location in new grid:', zz(i)
    1624             stop ' interhuntlimits/ Interpolat error. z out of limits.'
     1632            call abort_physic("interhuntlimits",
     1633     &      'interhuntlimits/ Interpolat error. z out of limits.',1)
    16251634         endif
    16261635
     
    17121721 11      continue             
    17131722         if (aamax.eq.0.0) then
    1714             write(*,*) 'ludcmp_dp: singular matrix!'
    1715             stop
     1723            call abort_physic("ludcmp_dp","singular matrix!",1)
    17161724         endif           
    17171725         vv(i)=1.0d0/aamax 
     
    22872295      else
    22882296
    2289          write (*,*) ' Error in suaviza.f   Wrong ismooth value.'
    2290          stop
     2297         call abort_physic("suaviza","Wrong ismooth value",1)
    22912298
    22922299      endif
     
    24032410      if ( nbox_stored(ihist) .gt. nbox_max ) then
    24042411         write (*,*) ' nbox too large in input file ', hisfile
    2405          stop ' Check maximum number nbox_max in mz1d.par '
     2412         call abort_physic("rhist_03",
     2413     &        'Check maximum number nbox_max in mz1d.par ',1)
    24062414      endif
    24072415
  • trunk/LMDZ.MARS/libf/phymars/nlte_calc.F

    r2151 r2398  
    767767            else
    768768               write (*,*) ' Error in 626 hot band index  ik =', ik
    769                stop ' ik can only be = 2,3,4.   Check needed.'
     769               call abort_physic("MZMC121",
     770     &              ' ik can only be = 2,3,4.   Check needed.',1)
    770771            end if
    771772            do j=1,nl
  • trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F

    r1524 r2398  
    277277            write (*,*) ' p_gcm, Pbottom_atm =',
    278278     $           p_gcm(n_gcm), Pbottom_atm
    279             stop ' Check input value "p_gcm" or modify "Pbottom_atm" '
     279            call abort_physic("nlte_tcool",
     280     &           'Check input value "p_gcm" or modify "Pbottom_atm"',1)
    280281         endif
    281282      enddo
     
    16321633
    16331634
    1634       stop ' Stopped in NLTE scheme due to severe error.'
     1635      call abort_physic("nlte_tcool",
     1636     &     'Stopped in NLTE scheme due to severe error.',1)
    16351637      end
  • trunk/LMDZ.MARS/libf/phymars/read_dust_scenario.F90

    r2137 r2398  
    103103     write(*,*)'   can be obtained online on:'
    104104     write(*,*)'   http://www.lmd.jussieu.fr/~lmdz/planets/mars/datadir'
    105      CALL ABORT
     105     CALL abort_physic("read_dust_scenario","Cannot find file",1)
    106106   ENDIF
    107107
     
    132132        PRINT*, "Error: read_dust_scenario <dustop> not found"
    133133        write(*,*)trim(nf90_strerror(ierr))
    134         stop
     134        call abort_physic("read_dust_scenario","dustop not found",1)
    135135     ENDIF
    136136   else
     
    141141        PRINT*, "Error: read_dust_scenario <cdod> not found"
    142142        write(*,*)trim(nf90_strerror(ierr))
    143         stop
     143        call abort_physic("read_dust_scenario","cdod not found",1)
    144144     ENDIF
    145145     ! and multiply by 2*1.3=2.6 to convert from IR absorption
     
    153153      PRINT*, "Error: read_dust_scenario <Time> not found"
    154154      write(*,*)trim(nf90_strerror(ierr))
    155       stop
     155      call abort_physic("read_dust_scenario","Time not found",1)
    156156   ENDIF
    157157
     
    161161      PRINT*, "Error: read_dust_scenario <latitude> not found"
    162162      write(*,*)trim(nf90_strerror(ierr))
    163       stop
     163      call abort_physic("read_dust_scenario","latitude not found",1)
    164164   ENDIF
    165165
     
    169169      PRINT*, "Error: read_dust_scenario <longitude> not found"
    170170      write(*,*)trim(nf90_strerror(ierr))
    171       stop
     171      call abort_physic("read_dust_scenario","longitude not found",1)
    172172   ENDIF
    173173
     
    191191    ! check if it is by a large amount
    192192    if ((londeg+180).lt.-1.e-3) then
    193       write(*,*) 'reattesassim: error!!'
    194193      write(*,*) ' ig=',ig,' londeg=',londeg
    195       stop
     194      call abort_physic("read_dust_scenario","longitude way out of range",1)
    196195    else
    197196      londeg=-180
     
    246245      write (*,*) "yinf: ",yinf
    247246      write (*,*) "ysup: ",ysup
    248       stop
     247      call abort_physic("read_dust_scenario","invalid coordinates",1)
    249248   endif
    250249
     
    319318          write (*,*) "tau2 ",taubuf(2)
    320319          write (*,*) "tau ",tau1(iloop)
    321           stop
     320          call abort_physic("read_dust_scenario","negative tau!",1)
    322321      endif
    323322   enddo
     
    329328      write (*,*) "dlon: ",dlon
    330329      write (*,*) "lon: ",londeg
    331       stop
     330      call abort_physic("read_dust_scenario","negative dlat or dlon!",1)
    332331   endif
    333332
Note: See TracChangeset for help on using the changeset viewer.