Ignore:
Timestamp:
Jan 31, 2024, 4:36:51 PM (2 years ago)
Author:
afalco
Message:

Pluto PCM:
Imported condense n2 from pluto.old.
Aerosol data from Pluto.old not yet working.
AF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/dynphy_lonlat/phypluto/lect_start_archive.F

    r3184 r3195  
    77
    88      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, volcapa, inertiedat
    9       USE tracer_h, ONLY: igcm_n2_ice
     9      USE tracer_h, ONLY: igcm_haze
    1010      USE infotrac, ONLY: tname, nqtot
    1111!      USE slab_ice_h, ONLY: noceanmx
     
    3939
    4040
    41 c Variables pour les lectures des fichiers "ini" 
     41c Variables pour les lectures des fichiers "ini"
    4242c--------------------------------------------------
    4343!      INTEGER sizei,
     
    5353!      character (len=50) :: tmpname
    5454
    55 c Variable histoire 
     55c Variable histoire
    5656c------------------
    5757      REAL,INTENT(OUT) :: vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants
     
    5959      REAL,INTENT(OUT) :: q(iip1,jjp1,llm,nqtot)
    6060
    61 c Physique sur grille scalaire 
     61c Physique sur grille scalaire
    6262c----------------------------
    6363
     
    112112
    113113
    114 c Variable de l'ancienne grille 
     114c Variable de l'ancienne grille
    115115c---------------------------------------------------------
    116116
     
    150150      logical :: therminertia_3D=.true. ! flag
    151151! therminertia_3D=.true. if thermal inertia is 3D and read from datafile
    152 c Variable intermediaires iutilise pour l'extrapolation verticale 
     152c Variable intermediaires iutilise pour l'extrapolation verticale
    153153c----------------------------------------------------------------
    154       real, dimension(:,:,:), allocatable :: var,varp1 
     154      real, dimension(:,:,:), allocatable :: var,varp1
    155155      real, dimension(:), allocatable :: oldgrid, oldval
    156156      real, dimension(:), allocatable :: newval
     
    158158      real,intent(out) :: surfith(iip1,jjp1) ! surface thermal inertia
    159159      ! surface thermal inertia at old horizontal grid resolution
    160       real, dimension(:,:), allocatable :: surfithold 
     160      real, dimension(:,:), allocatable :: surfithold
    161161
    162162      character(len=30) :: txt ! to store some text
     
    172172!-----------------------------------------------------------------------
    173173
    174 ! 1.2 Read the various dimension lengths of data in file 
     174! 1.2 Read the various dimension lengths of data in file
    175175
    176176      ierr= NF_INQ_DIMID(nid,"Time",dimid)
     
    245245
    246246! 1.3 Report dimensions
    247      
     247
    248248      write(*,*) "Start_archive dimensions:"
    249249      write(*,*) "longitude: ",imold
     
    259259      endif
    260260      write(*,*) "time lenght: ",timelen
    261       write(*,*) 
     261      write(*,*)
    262262
    263263!-----------------------------------------------------------------------
     
    311311
    312312C-----------------------------------------------------------------------
    313 c 3.1. Lecture du tableau des parametres du run 
     313c 3.1. Lecture du tableau des parametres du run
    314314c     (pour  la lecture ulterieure de "ptotalold" et "n2icetotalold")
    315315c-----------------------------------------------------------------------
     
    355355         PRINT*, "lect_start_archive: Field <rlatu> not found"
    356356         CALL abort
    357       ENDIF 
     357      ENDIF
    358358#ifdef NC_DOUBLE
    359359      ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatuold)
     
    440440c 3.4 Read Soil layers depths
    441441c-----------------------------------------------------------------------
    442      
     442
    443443      ierr=NF_INQ_VARID(nid,"soildepth",nvarid)
    444444      if (ierr.ne.NF_NOERR) then
     
    540540      ptotalold = tab_cntrl(tab0+49)
    541541      n2icetotalold = tab_cntrl(tab0+50)
    542  
     542
    543543c-----------------------------------------------------------------------
    544544c 4. Lecture du temps et choix
    545545c-----------------------------------------------------------------------
    546  
     546
    547547c  lecture du temps
    548548c
     
    559559      IF (ierr .NE. NF_NOERR) THEN
    560560         ierr = NF_INQ_VARID (nid, "temps", nvarid)
    561       endif 
     561      endif
    562562#ifdef NC_DOUBLE
    563563      ierr = NF_GET_VAR_DOUBLE(nid, nvarid, timelist)
     
    584584
    585585   6  FORMAT(i7,i7,f9.3)
    586  
     586
    587587      write(*,*)
    588588      write(*,*) 'Choice for the date'
     
    595595        endif
    596596      end do
    597  
     597
    598598      if (memo.eq.0) then
    599599        write(*,*)
     
    618618c 5.1 Lecture des champs 2D (n2ice, emis,ps,tsurf,Tg[10], qsurf)
    619619c-----------------------------------------------------------------------
    620  
     620
    621621      start=(/1,1,memo,0/)
    622622      count=(/imold+1,jmold+1,1,0/)
    623        
     623
    624624      ierr = NF_INQ_VARID (nid, "emis", nvarid)
    625625      IF (ierr .NE. NF_NOERR) THEN
     
    756756!          PRINT*, "lect_start_archive: Failed loading <sea_ice>"
    757757!       ENDIF
    758  
     758
    759759!       ENDIF! ok_slab_ocean
    760760c
     
    763763      write(*,*)
    764764
    765 ! Surface tracers:     
     765! Surface tracers:
    766766      ! initialize all surface tracers to zero
    767767      qsurfold(1:imold+1,1:jmold+1,1:nqtot)=0
     
    777777          endif
    778778
    779        
     779
    780780        write(*,*) "lect_start_archive: loading tracer ",trim(txt)
    781781        ierr = NF_INQ_VARID (nid,txt,nvarid)
     
    838838c
    839839       enddo ! of do isoil=1,nsoilold
    840      
     840
    841841      ! reset 'start' and 'count' to "3D" behaviour
    842842      start=(/1,1,1,memo/)
    843843      count=(/imold+1,jmold+1,nsoilold,1/)
    844      
     844
    845845      else
    846846       write(*,*) "lect_start_archive: loading tsoil "
     
    856856#endif
    857857       endif ! of if (ierr.ne.NF_NOERR)
    858        
     858
    859859      endif ! of if (olddepthdef)
    860860
     
    928928c
    929929
    930 ! Tracers:     
     930! Tracers:
    931931      qold(1:imold+1,1:jmold+1,1:lmold,1:nqtot)=0.
    932932
     
    10401040c   INTERPOLATION DANS LA NOUVELLE GRILLE et initialisation des variables
    10411041c=======================================================================
    1042 c  Interpolation horizontale puis passage dans la grille physique pour 
    1043 c  les variables physique 
     1042c  Interpolation horizontale puis passage dans la grille physique pour
     1043c  les variables physique
    10441044c  Interpolation verticale puis horizontale pour chaque variable 3D
    10451045c=======================================================================
     
    10481048c 6.1   Variable 2d :
    10491049c-----------------------------------------------------------------------
    1050 c Relief 
     1050c Relief
    10511051      call interp_horiz (phisold,phisold_newgrid,imold,jmold,iim,jjm,1,
    10521052     &                   rlonuold,rlatvold,rlonu,rlatv)
    10531053
    1054 ! N2 ice is now in qsurf(igcm_n2_ice)
     1054! N2 ice is now in qsurf(igcm_haze)
    10551055!      call interp_horiz (n2iceold,n2ices,imold,jmold,iim,jjm,1,
    10561056!     &                   rlonuold,rlatvold,rlonu,rlatv)
     
    10881088c       On assure la conservation de la masse de l'atmosphere + calottes
    10891089c-----------------------------------------------------------------------
     1090      !AF: TODO: mass conservation: check this. haze?
    10901091
    10911092      ptotal =  0.
     
    10961097      END DO
    10971098      n2icetotal = 0.
    1098       if (igcm_n2_ice.ne.0) then
     1099      if (igcm_haze.ne.0) then
    10991100        ! recast surface N2 ice on new grid
    1100         call interp_horiz(qsurfold(1,1,igcm_n2_ice),
    1101      &                  qsurfs(1,1,igcm_n2_ice),
     1101        call interp_horiz(qsurfold(1,1,igcm_haze),
     1102     &                  qsurfs(1,1,igcm_haze),
    11021103     &                  imold,jmold,iim,jjm,1,
    11031104     &                  rlonuold,rlatvold,rlonu,rlatv)
     
    11051106         DO i=1,iim
    11061107           !n2icetotal = n2icetotal + n2iceS(i,j)*aire(i,j)
    1107            n2icetotal=n2icetotal+qsurfS(i,j,igcm_n2_ice)*aire(i,j)
     1108           n2icetotal=n2icetotal+qsurfS(i,j,igcm_haze)*aire(i,j)
    11081109         END DO
    11091110       END DO
     
    11151116      write(*,*)'Old grid: atmospheric mass :',ptotalold
    11161117      write(*,*)'New grid: atmospheric mass :',ptotal
    1117       write (*,*) 'Ratio new atm./ old atm =', ptotal/ptotalold 
     1118      write (*,*) 'Ratio new atm./ old atm =', ptotal/ptotalold
    11181119      write(*,*)
    11191120      write(*,*)'Old grid: mass of N2 ice:',n2icetotalold
     
    11311132      END DO
    11321133
    1133       if ( n2icetotalold.gt.0.) then 
     1134      if ( n2icetotalold.gt.0.) then
    11341135!         DO j=1,jjp1
    11351136!            DO i=1,iip1
     
    11571158     &f soil thermal inertia; might be wiser to reset it.'
    11581159        write(*,*)
    1159        
     1160
    11601161        do i=1,imold+1
    11611162         do j=1,jmold+1
     
    11771178        ! We have inertiedatold
    11781179       if((imold.ne.iim).or.(jmold.ne.jjm)) then
    1179        write(*,*)'lect_start_archive: WARNING: horizontal interpolation 
     1180       write(*,*)'lect_start_archive: WARNING: horizontal interpolation
    11801181     &of thermal inertia; might be better to reset it.'
    11811182       write(*,*)
    11821183       endif
    1183        
     1184
    11841185        ! Do horizontal interpolation
    11851186        if (depthinterpol) then
     
    12101211      call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid,
    12111212     &                  inertiedatS,inertiedat)
    1212      
     1213
    12131214c-----------------------------------------------------------------------
    12141215c 6.2.2 Soil temperature
     
    12821283        deallocate(oldval)
    12831284        deallocate(newval)
    1284        
     1285
    12851286       else
    12861287        tsoiloldnew(:,:,:)=tsoilold(:,:,:)
     
    13031304c 6.4 Variable 3d :
    13041305c-----------------------------------------------------------------------
    1305      
     1306
    13061307c temperatures atmospheriques
    13071308      write (*,*) 'lect_start_archive: told ', told (1,jmold+1,1)  ! INFO
     
    13211322     &                   rlonuold,rlatvold,rlonu,rlatv)
    13221323      call gr_dyn_fi(llm,iim+1,jjm+1,ngrid,du_nonoro_gwdS,du_nonoro_gwd)
    1323      
     1324
    13241325      call interp_vert
    13251326     &    (dv_nonoro_gwdold,var,lmold,llm,apsold,bpsold,aps,bps,
     
    13281329     &                   rlonuold,rlatvold,rlonu,rlatv)
    13291330      call gr_dyn_fi(llm,iim+1,jjm+1,ngrid,dv_nonoro_gwdS,dv_nonoro_gwd)
    1330      
     1331
    13311332      call interp_vert
    13321333     &    (east_gwstressold,var,lmold,llm,apsold,bpsold,aps,bps,
     
    13351336     &                   rlonuold,rlatvold,rlonu,rlatv)
    13361337      call gr_dyn_fi(llm,iim+1,jjm+1,ngrid,east_gwstressS,east_gwstress)
    1337      
     1338
    13381339      call interp_vert
    13391340     &    (west_gwstressold,var,lmold,llm,apsold,bpsold,aps,bps,
     
    13791380          end do
    13801381        end do
    1381       end do 
     1382      end do
    13821383      write (*,*) 'lect_start_archive: ucov ', ucov (1,2,1)  ! INFO
    13831384c     write(48,*) 'ucov',ucov
     
    14101411     &                  rlonuold,rlatvold,rlonu,rlatv)
    14111412      enddo
    1412 cccccccccccccccccccccccccccccc     
    1413 c  make sure that sum of q = 1     
    1414 c dominent species is = 1 - sum(all other species)     
    1415 cccccccccccccccccccccccccccccc     
     1413cccccccccccccccccccccccccccccc
     1414c  make sure that sum of q = 1
     1415c dominent species is = 1 - sum(all other species)
     1416cccccccccccccccccccccccccccccc
    14161417c      iqmax=1
    1417 c     
     1418c
    14181419c      if (nqold.gt.10) then
    14191420c       do l=1,llm
     
    14281429c           qtot(i,j,l)=0
    14291430c           do iq=1,nqold
    1430 c            if (iq.ne.iqmax) then       
    1431 c              q(i,j,l,iqmax)=q(i,j,l,iqmax)-q(i,j,l,iq)       
     1431c            if (iq.ne.iqmax) then
     1432c              q(i,j,l,iqmax)=q(i,j,l,iqmax)-q(i,j,l,iq)
    14321433c            endif
    14331434c           enddo !iq
     
    14371438c     $    qtot(i,j,l)
    14381439c           enddo !iq
    1439 c          enddo !i   
    1440 c         enddo !j   
    1441 c       enddo !l 
     1440c          enddo !i
     1441c         enddo !j
     1442c       enddo !l
    14421443c      endif
    14431444ccccccccccccccccccccccccccccccc
     
    14511452         end do
    14521453      enddo
    1453      
     1454
    14541455!      call gr_dyn_fi (1,iim+1,jjm+1,ngrid,n2ices,n2ice)
    1455 ! no need to transfer "n2ice" any more; it is in qsurf(igcm_n2_ice)
     1456! no need to transfer "n2ice" any more; it is in qsurf(igcm_haze)
    14561457
    14571458      endif !! if nqtot .ne. 0
Note: See TracChangeset for help on using the changeset viewer.