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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F

    r38 r164  
    120120              write(*,*) 'initracer: error expected dustbin=2'
    121121            else
    122               noms(1)='dust_mass'   ! dust mass mixing ratio
    123               noms(2)='dust_number' ! dust number mixing ratio
     122!              noms(1)='dust_mass'   ! dust mass mixing ratio
     123!              noms(2)='dust_number' ! dust number mixing ratio
     124! same as above, but avoid explict possible out-of-bounds on array
     125               noms(1)='dust_mass'   ! dust mass mixing ratio
     126               do iq=2,2
     127               noms(iq)='dust_number' ! dust number mixing ratio
     128               enddo
    124129            endif
    125130          endif
     
    129134          noms(nqmx)='h2o_vap'
    130135          mmol(nqmx)=18.
    131           noms(nqmx-1)='h2o_ice'
    132           mmol(nqmx-1)=18.
     136!            noms(nqmx-1)='h2o_ice'
     137!            mmol(nqmx-1)=18.
     138          !"loop" to avoid potential out-of-bounds in array
     139          do iq=nqmx-1,nqmx-1
     140            noms(iq)='h2o_ice'
     141            mmol(iq)=18.
     142          enddo
    133143        endif
    134144        ! 3. Chemistry
     
    164174        write(*,*)'inichim_newstart: moving surface water ice to index '
    165175     &            ,nqmx-1
    166         qsurf(1:ngridmx,nqmx-1)=qsurf(1:ngridmx,nqmx)
     176        ! "loop" to avoid potential out-of-bounds on arrays
     177        do iq=nqmx-1,nqmx-1
     178        qsurf(1:ngridmx,iq)=qsurf(1:ngridmx,iq+1)
     179        enddo
    167180        qsurf(1:ngridmx,nqmx)=0
    168181      endif
     
    395408      ! as in the old days, water vapour is last and water ice,
    396409      ! if present, is just before water vapour
    397       nqchem(1)=igcm_co2
    398       nqchem(2)=igcm_co
    399       nqchem(3)=igcm_o
    400       nqchem(4)=igcm_o1d
    401       nqchem(5)=igcm_o2
    402       nqchem(6)=igcm_o3
    403       nqchem(7)=igcm_h
    404       nqchem(8)=igcm_h2
    405       nqchem(9)=igcm_oh
    406       nqchem(10)=igcm_ho2
    407       nqchem(11)=igcm_h2o2
    408       nqchem(12)=igcm_n2
    409       nqchem(13)=igcm_ar
    410       nqchem(14)=igcm_h2o_ice
    411       nqchem(15)=igcm_h2o_vap
     410      do iq=1,15 ! loop so as to avoid out-of-bounds on array
     411      if (iq==1) nqchem(i)=igcm_co2
     412      if (iq==2) nqchem(i)=igcm_co
     413      if (iq==3) nqchem(i)=igcm_o
     414      if (iq==4) nqchem(i)=igcm_o1d
     415      if (iq==5) nqchem(i)=igcm_o2
     416      if (iq==6) nqchem(i)=igcm_o3
     417      if (iq==7) nqchem(i)=igcm_h
     418      if (iq==8) nqchem(i)=igcm_h2
     419      if (iq==9) nqchem(i)=igcm_oh
     420      if (iq==10) nqchem(i)=igcm_ho2
     421      if (iq==11) nqchem(i)=igcm_h2o2
     422      if (iq==12) nqchem(i)=igcm_n2
     423      if (iq==13) nqchem(i)=igcm_ar
     424      if (iq==14) nqchem(i)=igcm_h2o_ice
     425      if (iq==15) nqchem(i)=igcm_h2o_vap
     426      enddo
    412427
    413428! Load in chemistry data for initialization:
Note: See TracChangeset for help on using the changeset viewer.