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/dyn3d
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F

    r146 r164  
    11361136        allocate(oldval(nsoilold+1))
    11371137        allocate(newval(nsoilmx))
    1138         do i=1,imold+1
    1139          do j=1,jmold+1
     1138        do i=1,iip1
     1139         do j=1,jjp1
    11401140           ! copy values
    11411141           oldval(1)=tsurfold(i,j)
     
    11681168        oldgrid(1)=0. ! ground
    11691169        oldgrid(2:nsoilold+1)=mlayerold(1:nsoilold)
    1170         do i=1,imold+1
    1171          do j=1,jmold+1
     1170        do i=1,iip1
     1171         do j=1,jjp1
    11721172           ! copy values
    11731173           oldval(1)=tsurfold(i,j)
  • trunk/LMDZ.MARS/libf/dyn3d/newstart.F

    r38 r164  
    1414c
    1515c=======================================================================
     16
     17! to use  'getin'
     18      USE ioipsl_getincom
    1619
    1720      implicit none
     
    4043#include"advtrac.h"
    4144#include"tracer.h"
     45#include "datafile.h"
    4246c=======================================================================
    4347c   Declarations
     
    5054c et autres:
    5155c----------
    52       INTEGER lnblnk
    53       EXTERNAL lnblnk
    5456
    5557c Variables pour les lectures NetCDF des fichiers "start_archive"
     
    358360        relief="mola"
    359361c     enddo
     362
     363! before using datareadnc, "datafile" must be set (normaly done in inifis)
     364      datafile="/u/forget/WWW/datagcm/datafile" ! default value
     365      call getin("datadir",datafile) ! in case user specified another path
    360366
    361367      CALL datareadnc(relief,phis,alb,surfith,zmeaS,zstdS,zsigS,zgamS,
     
    499505
    500506        write(*,*)
    501         write(*,*) modif(1:lnblnk(modif)) , ' : '
     507        write(*,*) trim(modif) , ' : '
    502508
    503509c       'flat : no topography ("aquaplanet")'
    504510c       -------------------------------------
    505         if (modif(1:lnblnk(modif)) .eq. 'flat') then
     511        if (trim(modif) .eq. 'flat') then
    506512c         set topo to zero
    507513          CALL initial0(ip1jmp1,z_reel)
     
    537543c       bilball : albedo, inertie thermique uniforme
    538544c       --------------------------------------------
    539         else if (modif(1:lnblnk(modif)) .eq. 'bilball') then
     545        else if (trim(modif) .eq. 'bilball') then
    540546          write(*,*) 'constante albedo and iner.therm:'
    541547          write(*,*) 'New value for albedo (ex: 0.25) ?'
     
    564570c       coldspole : sous-sol de la calotte sud toujours froid
    565571c       -----------------------------------------------------
    566         else if (modif(1:lnblnk(modif)) .eq. 'coldspole') then
     572        else if (trim(modif) .eq. 'coldspole') then
    567573          write(*,*)'new value for the subsurface temperature',
    568574     &   ' beneath the permanent southern polar cap ? (eg: 141 K)'
     
    615621c       ptot : Modification of the total pressure: ice + current atmosphere
    616622c       -------------------------------------------------------------------
    617         else if (modif(1:lnblnk(modif)) .eq. 'ptot') then
     623        else if (trim(modif) .eq. 'ptot') then
    618624
    619625c         calcul de la pression totale glace + atm actuelle
     
    699705c       q=0 : set tracers to zero
    700706c       -------------------------
    701         else if (modif(1:lnblnk(modif)) .eq. 'q=0') then
     707        else if (trim(modif) .eq. 'q=0') then
    702708c          mise a 0 des q (traceurs)
    703709          write(*,*) 'Tracers set to 0 (1.E-30 in fact)'
     
    721727c       q=x : initialise tracer manually
    722728c       --------------------------------
    723         else if (modif(1:lnblnk(modif)) .eq. 'q=x') then
     729        else if (trim(modif) .eq. 'q=x') then
    724730             write(*,*) 'Which tracer do you want to modify ?'
    725731             do iq=1,nqmx
     
    747753c       ini_q : Initialize tracers for chemistry
    748754c       -----------------------------------------------
    749         else if (modif(1:lnblnk(modif)) .eq. 'ini_q') then
     755        else if (trim(modif) .eq. 'ini_q') then
    750756c         For more than 32 layers, possible to initiate thermosphere only     
    751757          thermo=0
     
    779785c       ini_q-H2O : as above exept for the water vapour tracer
    780786c       ------------------------------------------------------
    781         else if (modif(1:lnblnk(modif)) .eq. 'ini_q-H2O') then
     787        else if (trim(modif) .eq. 'ini_q-H2O') then
    782788          ! for more than 32 layers, possible to initiate thermosphere only     
    783789          thermo=0
     
    812818c       ini_q-iceH2O : as above exept for ice et H2O
    813819c       -----------------------------------------------
    814         else if (modif(1:lnblnk(modif)) .eq. 'ini_q-iceH2O') then
     820        else if (trim(modif) .eq. 'ini_q-iceH2O') then
    815821c         For more than 32 layers, possible to initiate thermosphere only     
    816822          thermo=0
     
    846852c      wetstart : wet atmosphere with a north to south gradient
    847853c      --------------------------------------------------------
    848        else if (modif(1:lnblnk(modif)) .eq. 'wetstart') then
     854       else if (trim(modif) .eq. 'wetstart') then
    849855        ! check that there is indeed a water vapor tracer
    850856        if (igcm_h2o_vap.eq.0) then
     
    867873c      noglacier : remove tropical water ice (to initialize high res sim)
    868874c      --------------------------------------------------
    869         else if (modif(1:lnblnk(modif)) .eq. 'noglacier') then
     875        else if (trim(modif) .eq. 'noglacier') then
    870876           do ig=1,ngridmx
    871877             j=(ig-2)/iim +2
     
    880886c      watercapn : H20 ice on permanent northern cap
    881887c      --------------------------------------------------
    882         else if (modif(1:lnblnk(modif)) .eq. 'watercapn') then
     888        else if (trim(modif) .eq. 'watercapn') then
    883889           do ig=1,ngridmx
    884890             j=(ig-2)/iim +2
     
    895901c      watercaps : H20 ice on permanent southern cap
    896902c      -------------------------------------------------
    897         else if (modif(1:lnblnk(modif)) .eq. 'watercaps') then
     903        else if (trim(modif) .eq. 'watercaps') then
    898904           do ig=1,ngridmx
    899905               j=(ig-2)/iim +2
     
    910916c       isotherm : Isothermal temperatures and no winds
    911917c       ------------------------------------------------
    912         else if (modif(1:lnblnk(modif)) .eq. 'isotherm') then
     918        else if (trim(modif) .eq. 'isotherm') then
    913919
    914920          write(*,*)'Isothermal temperature of the atmosphere,
     
    933939c       co2ice=0 : remove CO2 polar ice caps'
    934940c       ------------------------------------------------
    935         else if (modif(1:lnblnk(modif)) .eq. 'co2ice=0') then
     941        else if (trim(modif) .eq. 'co2ice=0') then
    936942           do ig=1,ngridmx
    937943              co2ice(ig)=0
     
    942948!       ----------------------------------------------------------------------
    943949
    944         else if (modif(1:lnblnk(modif)).eq.'therm_ini_s') then
     950        else if (trim(modif).eq.'therm_ini_s') then
    945951!          write(*,*)"surfithfi(1):",surfithfi(1)
    946952          do isoil=1,nsoilmx
     
    965971!       ------------------------------------------------------------
    966972
    967         else if (modif(1:lnblnk(modif)).eq.'subsoilice_n') then
     973        else if (trim(modif).eq.'subsoilice_n') then
    968974
    969975         write(*,*)'From which latitude (in deg.), up to the north pole,
     
    10781084!       ------------------------------------------------------------
    10791085
    1080         else if (modif(1:lnblnk(modif)).eq.'subsoilice_s') then
     1086        else if (trim(modif).eq.'subsoilice_s') then
    10811087
    10821088         write(*,*)'From which latitude (in deg.), down to the south pol
     
    11791185c       'mons_ice' : use MONS data to build subsurface ice table
    11801186c       --------------------------------------------------------
    1181         else if (modif(1:lnblnk(modif)).eq.'mons_ice') then
     1187        else if (trim(modif).eq.'mons_ice') then
    11821188       
    11831189       ! 1. Load MONS data
     
    12851291        else
    12861292          write(*,*) '       Unknown (misspelled?) option!!!'
    1287         end if ! of if (modif(1:lnblnk(modif)) .eq. '...') elseif ...
     1293        end if ! of if (trim(modif) .eq. '...') elseif ...
    12881294       
    12891295       enddo ! of do ! infinite loop on liste of changes
Note: See TracChangeset for help on using the changeset viewer.