Ignore:
Timestamp:
Jun 17, 2011, 10:49:17 AM (14 years ago)
Author:
emillour
Message:

Mars GCM:

Updates and corrections (to enable compiling/running in debug mode with

ifort)

  • removed option "-free-form" from makegcm_ifort and set mod_loc_dir="." so that module files (produced in local directory by ifort) are moved to LIBO
  • updated initracer.F, physdem1.F, physiq.F, inichim_newstart.F to avoid referencing out-of-bound array indexes (even if unused)
  • cosmetic updates on inwrite.F, datareadnc.F
  • updated newstart.F to initialize and use 'datadir' when looking for files
  • corrected bug on interpolation of sub-surface temperatures in lect_start_archive.F

EM

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

Legend:

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

    r146 r164  
    123123        write(*,*)'1) You can set this path in the callphys.def file:'
    124124        write(*,*)'   datadir=/path/to/the/datafiles'
    125         write(*,*)'2) If necessary surface.nc (and other datafiles)'
     125        write(*,*)'   OR specify the path to use in callphys.def, as:'
     126        write(*,*)'   datadir=/path/to/the/directory'
     127        write(*,*)'2) If necessary, surface.nc (and other datafiles)'
    126128        write(*,*)'   can be obtained online on:'
    127129        write(*,*)' http://www.lmd.jussieu.fr/~forget/datagcm/datafile'
  • trunk/LMDZ.MARS/libf/phymars/initracer.F

    r91 r164  
    111111              write(*,*) 'initracer: error expected dustbin=2'
    112112            else
    113               noms(1)='dust_mass'   ! dust mass mixing ratio
    114               noms(2)='dust_number' ! dust number mixing ratio
     113!              noms(1)='dust_mass'   ! dust mass mixing ratio
     114!              noms(2)='dust_number' ! dust number mixing ratio
     115! same as above, but avoid explict possible out-of-bounds on array
     116               noms(1)='dust_mass'   ! dust mass mixing ratio
     117               do iq=2,2
     118               noms(iq)='dust_number' ! dust number mixing ratio
     119               enddo
    115120            endif
    116121          endif
     
    120125          noms(nqmx)='h2o_vap'
    121126          mmol(nqmx)=18.
    122           noms(nqmx-1)='h2o_ice'
    123           mmol(nqmx-1)=18.
     127!            noms(nqmx-1)='h2o_ice'
     128!            mmol(nqmx-1)=18.
     129          !"loop" to avoid potential out-of-bounds in array
     130          do iq=nqmx-1,nqmx-1
     131            noms(iq)='h2o_ice'
     132            mmol(iq)=18.
     133          enddo
    124134        endif
    125135        ! 3. Chemistry
     
    157167      if (oldnames.and.water) then
    158168        write(*,*)'initracer: moving surface water ice to index ',nqmx-1
    159         qsurf(1:ngridmx,nqmx-1)=qsurf(1:ngridmx,nqmx)
     169        ! "loop" to avoid potential out-of-bounds on arrays
     170        do iq=nqmx-1,nqmx-1
     171          qsurf(1:ngridmx,iq)=qsurf(1:ngridmx,iq+1)
     172        enddo
    160173        qsurf(1:ngridmx,nqmx)=0
    161174      endif
  • trunk/LMDZ.MARS/libf/phymars/iniwrite.F

    r38 r164  
    3636c   ----------
    3737
    38       integer nid        ! NetCDF file ID
    39       INTEGER*4 idayref  ! date (initial date for this run)
    40       REAL phis(ip1jmp1) ! surface geopotential
     38      integer,intent(in) :: nid        ! NetCDF file ID
     39      INTEGER*4,intent(in) :: idayref  ! date (initial date for this run)
     40      real,intent(in) :: phis(ip1jmp1) ! surface geopotential
    4141
    4242c   Local:
  • trunk/LMDZ.MARS/libf/phymars/physdem1.F

    r38 r164  
    565565        ! back to qsurf(nqmx)
    566566        IF (water) THEN
     567          !"loop" to avoid potential out-of-bounds on arrays
    567568          write(*,*)'physdem1: moving surface water ice to index ',nqmx
    568           qsurf(1:ngridmx,nqmx)=qsurf(1:ngridmx,nqmx-1)
    569           qsurf(1:ngridmx,nqmx-1)=0
     569          do iq=nqmx,nqmx
     570          qsurf(1:ngridmx,iq)=qsurf(1:ngridmx,iq-1)
     571          qsurf(1:ngridmx,iq-1)=0
     572          enddo
    570573        ENDIF
    571574      endif ! of if (count.eq.nqmx)
  • trunk/LMDZ.MARS/libf/phymars/physiq.F

    r161 r164  
    13081308c        call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2,
    13091309c    &                  emis)
    1310          call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",3,zplay)
    1311          call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",3,zplev)
     1310!         call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",3,zplay)
     1311!         call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",3,zplev)
    13121312         call WRITEDIAGFI(ngrid,"tsurf","Surface temperature","K",2,
    13131313     &                  tsurf)
    13141314         call WRITEDIAGFI(ngrid,"ps","surface pressure","Pa",2,ps)
    1315 c        call WRITEDIAGFI(ngrid,"co2ice","co2 ice thickness","kg.m-2",2,
    1316 c    &                  co2ice)
     1315        call WRITEDIAGFI(ngrid,"co2ice","co2 ice thickness","kg.m-2",2,
     1316     &                  co2ice)
    13171317c         call WRITEDIAGFI(ngrid,"temp7","temperature in layer 7",
    13181318c     &                  "K",2,zt(1,7))
     
    13311331         call WRITEDIAGFI(ngrid,"rho","density","none",3,rho)
    13321332c        call WRITEDIAGFI(ngrid,"q2","q2","kg.m-3",3,q2)
    1333         call WRITEDIAGFI(ngrid,'Teta','T potentielle','K',3,zh)
     1333!        call WRITEDIAGFI(ngrid,'Teta','T potentielle','K',3,zh)
    13341334c        call WRITEDIAGFI(ngrid,"pressure","Pressure","Pa",3,pplay)
    13351335c        call WRITEDIAGFI(ngrid,"ssurf","Surface stress","N.m-2",2,
     
    15361536     &                  zq(ig,l,1)*(pplev(ig,l)-pplev(ig,l+1))/g
    15371537         if (nqmx .gt. 1) then
     1538             iq=2 ! to avoid out-of-bounds spotting by picky compilers
     1539                  ! when gcm is compiled with only one tracer
    15381540             dummycol(ig)=dummycol(ig)+
    1539      &                  zq(ig,l,2)*(pplev(ig,l)-pplev(ig,l+1))/g
     1541     &                  zq(ig,l,iq)*(pplev(ig,l)-pplev(ig,l+1))/g
    15401542         endif
    15411543         enddo
Note: See TracChangeset for help on using the changeset viewer.