Changeset 3254 for trunk


Ignore:
Timestamp:
Mar 6, 2024, 5:00:24 PM (9 months ago)
Author:
emillour
Message:

Venus PCM:
Some minor fixes to rcm1d (uninitialized variables) and add possibility to run a
fraction of a Venus day and not just an integer number of days.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/rcm1d.F

    r2851 r3254  
    5151      INTEGER ilayer,ilevel,isoil,idt,iq,i
    5252      LOGICAl firstcall,lastcall
     53      REAL :: nb_days ! number of Vdays (and/or fraction thererof) to run
    5354c
    5455      INTEGER day0          ! date initial (sol ; =0 a Ls=0)
     
    8586
    8687!     initialisation des traceurs
    87 
     88      logical :: file_is_present
    8889      integer :: idummy
    8990      real :: dummy
     
    195196
    196197      PRINT *,'nombre de jours simules ?'
    197       READ(unit,*) ndt
    198       print*,ndt
    199 
    200       ndt=ndt*day_step     
     198      READ(unit,*) nb_days
     199      print*,nb_days
     200
     201      ndt=nint(nb_days*day_step) 
     202      write(*,*) " => will run ", ndt," timesteps"   
    201203      dtphys=daysec/day_step 
    202204      dtime=dtphys
     
    265267         u(ilayer)=gru
    266268         v(ilayer)=grv
     269         w(ilayer)=0
    267270      ENDDO
    268271
     
    346349      ENDDO
    347350
    348       print*,"lecture des profils chimiques"
    349       open(21, form = 'formatted', file = 'init_1D.txt')
    350       read(21,*)
    351       do ilayer = nlayer,1,-1
    352          read(21,*) idummy, dummy, dummy, (q(ilayer,iq), iq = 1,nqtot)
     351      print*,"rcm1d: Loading chemistry profiles from init_1D.txt"
     352      ! check if the file is indeed there
     353      inquire(file="init_1D.txt",exist=file_is_present)
     354      if (file_is_present) then
     355        open(21, form = 'formatted', file = 'init_1D.txt')
     356        read(21,*)
     357        do ilayer = nlayer,1,-1
     358          read(21,*) idummy, dummy, dummy, (q(ilayer,iq), iq = 1,nqtot)
    353359!        print*, idummy, q(ilayer,1), q(ilayer,nqtot)
    354       end do
    355       close(21)
     360        end do
     361        close(21)
     362      else
     363        write(*,*) "Cannot find input file init_1D.txt!"
     364        write(*,*) "Might as well stop here"
     365        stop
     366      endif ! of if(file_is_present)
    356367
    357368c    Initialisation des parametres d'oro
     
    380391      sollw(1)    = 0.
    381392      fder(1)     = 0.
     393      dlw(1)      = 0.
     394      sollwdown(1)= 0.
    382395      radsol(1)   = 0.
    383      
     396
     397      t_ancien(1,:)=0.
     398      q2(1,:)=0.
     399
    384400      radpas      = NINT(1.*day_step/nbapp_rad)
    385401      soil_model  = .true.
     
    402418c     Ouverture du fichier d'écriture des VMR
    403419
    404       OPEN(5,file='chem.txt',form = 'formatted')
    405       WRITE(5,'(2x,100a12)')'hpa',(specname(i), i=1,nqtot)
     420      OPEN(15,file='chem.txt',form = 'formatted')
     421      WRITE(15,'(2x,100a12)')'hpa',(specname(i), i=1,nqtot)
    406422
    407423!     debut de boucle temporelle
    408424
    409       DO idt=1,48000
     425      DO idt=1,ndt
    410426        IF (idt.eq.ndt) then
    411427         lastcall=.true.
     
    516532         if (mod(idt,9600)==0) then   
    517533              DO ilayer=1,nlayer
    518                  write (5,'(100e12.4)')play(ilayer)/100., q(ilayer,:)
     534                 write (15,'(100e12.4)')play(ilayer)/100., q(ilayer,:)
    519535     $                 *mmean(1,ilayer)/mmol(:)
    520536              ENDDO   
     
    522538      ENDDO   ! fin de la boucle temporelle
    523539
    524       close(5)
     540      close(15)
    525541c    ========================================================
    526542c    GESTION DES SORTIE
Note: See TracChangeset for help on using the changeset viewer.