Changeset 3501


Ignore:
Timestamp:
Nov 8, 2024, 10:56:39 AM (4 weeks ago)
Author:
afalco
Message:

Pluto PCM: removed useless code.
Reindenting.
AF

Location:
trunk/LMDZ.PLUTO/libf/phypluto
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90

    r3444 r3501  
    240240         if (aerohaze) then
    241241
    242            print*,'aerohaze: starting suaer_corrk'
    243            call suaer_corrk       ! set up aerosol optical properties
    244            print*,'ending suaer_corrk'
     242           ! AF24: TODO check duplicate suaer_corrk called from physiq_mod
     243          !  print*,'aerohaze: starting suaer_corrk'
     244          !  call suaer_corrk       ! set up aerosol optical properties
     245          !  print*,'ending suaer_corrk'
    245246
    246247           !--------------------------------------------------
     
    256257           end do !iaer=1,naerkind.
    257258           if (haze_radproffix) then
    258                 if (haze_radproffix) then
    259                     call haze_reffrad_fix(ngrid,nlayer,zzlay, &
    260                         reffrad,nueffrad)
    261                 endif
     259              call haze_reffrad_fix(ngrid,nlayer,zzlay, &
     260                  reffrad,nueffrad)
    262261              print*, 'haze_radproffix=T : fixed profile for haze rad'
    263262           else
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3500 r3501  
    21032103           ENDDO
    21042104         ENDIF
    2105        endif
    2106 
    2107        if (carbox) then
     2105      endif
     2106
     2107      if (carbox) then
    21082108         IF (fast) then
    21092109           DO ig=1,ngrid
     
    21222122          ENDDO
    21232123         ENDIF
    2124        endif
    2125 
    2126        zrho_haze(:,:)=0.
    2127        zdqrho_photprec(:,:)=0.
    2128        IF (haze.and.aerohaze) then
    2129         DO ig=1,ngrid
    2130          DO l=1,nlayer
    2131                 zrho_haze(ig,l)=zq(ig,l,igcm_haze)*rho(ig,l)
    2132                 zdqrho_photprec(ig,l)=zdqphot_prec(ig,l)*rho(ig,l)
    2133              ENDDO
     2124      endif
     2125
     2126      zrho_haze(:,:)=0.
     2127      zdqrho_photprec(:,:)=0.
     2128      IF (haze.and.aerohaze) then
     2129         DO ig=1,ngrid
     2130            DO l=1,nlayer
     2131               zrho_haze(ig,l)=zq(ig,l,igcm_haze)*rho(ig,l)
     2132               zdqrho_photprec(ig,l)=zdqphot_prec(ig,l)*rho(ig,l)
     2133            ENDDO
    21342134         ENDDO
    21352135       ENDIF
    21362136
    2137        IF (fasthaze) then
    2138         DO ig=1,ngrid
    2139            qcol(ig,igcm_haze)=zq(ig,1,igcm_haze)*pplev(ig,1)/g
    2140            qcol(ig,igcm_prec_haze)=zq(ig,1,igcm_prec_haze)*pplev(ig,1)/g
    2141         ENDDO
    2142        ENDIF
     2137      IF (fasthaze) then
     2138         DO ig=1,ngrid
     2139            qcol(ig,igcm_haze)=zq(ig,1,igcm_haze)*pplev(ig,1)/g
     2140            qcol(ig,igcm_prec_haze)=zq(ig,1,igcm_prec_haze)*pplev(ig,1)/g
     2141         ENDDO
     2142      ENDIF
    21432143
    21442144 !     Info about Ls, declin...
    2145        IF (fast) THEN
     2145      IF (fast) THEN
    21462146         if (is_master) write(*,*),'Ls=',zls*180./pi,' dec=',declin*180./pi
    21472147         if (is_master) write(*,*),'zday=',zday,' ps=',globave
    2148         IF (lastcall) then
    2149          if (is_master) write(*,*),'lastcall'
    2150         ENDIF
    2151        ELSE
     2148         IF (lastcall) then
     2149            if (is_master) write(*,*),'lastcall'
     2150         ENDIF
     2151      ELSE
    21522152         if (is_master) write(*,*),'Ls=',zls*180./pi,'decli=',declin*180./pi,'zday=',zday
    2153        ENDIF
    2154 
    2155        lecttsoil=0 ! default value for lecttsoil
    2156        call getin_p("lecttsoil",lecttsoil)
    2157        IF (lastcall.and.(ngrid.EQ.1).and.(lecttsoil.eq.1)) THEN
    2158        ! save tsoil temperature profile for 1D profile
    2159           OPEN(13,file='proftsoil.out',form='formatted')
    2160           DO i=1,nsoilmx
    2161              write(13,*) tsoil(1,i)
    2162           ENDDO
    2163           CLOSE(13)
    2164        ENDIF
    2165 
     2153      ENDIF
     2154
     2155      lecttsoil=0 ! default value for lecttsoil
     2156      call getin_p("lecttsoil",lecttsoil)
     2157      IF (lastcall.and.(ngrid.EQ.1).and.(lecttsoil.eq.1)) THEN
     2158      ! save tsoil temperature profile for 1D profile
     2159         OPEN(13,file='proftsoil.out',form='formatted')
     2160         DO i=1,nsoilmx
     2161            write(13,*) tsoil(1,i)
     2162         ENDDO
     2163         CLOSE(13)
     2164      ENDIF
    21662165
    21672166      if (is_master) print*,'--> Ls =',zls*180./pi
    2168 
    2169 
    2170 !----------------------------------------------------------------------
    2171 !        Writing NetCDF file  "RESTARTFI" at the end of the run
    2172 !----------------------------------------------------------------------
    2173 
    2174 !        Note: 'restartfi' is stored just before dynamics are stored
    2175 !              in 'restart'. Between now and the writting of 'restart',
    2176 !              there will have been the itau=itau+1 instruction and
    2177 !              a reset of 'time' (lastacll = .true. when itau+1= itaufin)
    2178 !              thus we store for time=time+dtvr
    2179 
    2180 
    21812167
    21822168      if(lastcall) then
     
    22302216            ! Finally ensure conservation of qsurf
    22312217            DO iq=1,nq
    2232               call globalaverage2d(ngrid,qsurf(:,iq),globaveice(iq))
    2233               call globalaverage2d(ngrid,qsurfpal(:,iq), &
     2218               call globalaverage2d(ngrid,qsurf(:,iq),globaveice(iq))
     2219               call globalaverage2d(ngrid,qsurfpal(:,iq), &
    22342220                                             globavenewice(iq))
    2235               IF (globavenewice(iq).gt.0.) THEN
    2236                  qsurfpal(:,iq)=qsurfpal(:,iq)* &
     2221               IF (globavenewice(iq).gt.0.) THEN
     2222                  qsurfpal(:,iq)=qsurfpal(:,iq)* &
    22372223                                   globaveice(iq)/globavenewice(iq)
    2238               ENDIF
     2224               ENDIF
    22392225            ENDDO
    22402226
     
    22432229            !phisfipal(ig)=phisfi(ig)
    22442230
    2245 
    22462231            if (kbo.or.triton) then !  case of Triton : we do not change the orbital parameters
    2247 
    2248               pdaypal=pday ! no increment of pdaypal to keep same evolution of the subsolar point
    2249               eccpal=1.-periastr/((periastr+apoastr)/2.)    !no change of ecc
    2250               peri_daypal=peri_day ! no change
    2251               oblipal=obliquit     ! no change
    2252               tpalnew=tpal
    2253               adjustnew=adjust
     2232               pdaypal=pday ! no increment of pdaypal to keep same evolution of the subsolar point
     2233               eccpal=1.-periastr/((periastr+apoastr)/2.)    !no change of ecc
     2234               peri_daypal=peri_day ! no change
     2235               oblipal=obliquit     ! no change
     2236               tpalnew=tpal
     2237               adjustnew=adjust
    22542238
    22552239            else  ! Pluto
    2256               ! update new pday and tpal (Myr) to be set in startfi controle
    2257               pdaypal=int(day_ini+paleoyears*365.25/6.3872)
    2258               tpalnew=tpal+paleoyears*1.e-6  ! Myrs
    2259 
    2260               ! update new N2 ice adjustment (not tested yet on Pluto)
    2261               adjustnew=adjust
    2262 
    2263               ! update milankovitch parameters : obliquity,Lsp,ecc
    2264               call calcmilank(tpalnew,oblipal,peri_daypal,eccpal)
    2265               !peri_daypal=peri_day
    2266               !eccpal=0.009
    2267 
     2240               ! update new pday and tpal (Myr) to be set in startfi controle
     2241               pdaypal=int(day_ini+paleoyears*365.25/6.3872)
     2242               tpalnew=tpal+paleoyears*1.e-6  ! Myrs
     2243
     2244               ! update new N2 ice adjustment (not tested yet on Pluto)
     2245               adjustnew=adjust
     2246
     2247               ! update milankovitch parameters : obliquity,Lsp,ecc
     2248               call calcmilank(tpalnew,oblipal,peri_daypal,eccpal)
     2249               !peri_daypal=peri_day
     2250               !eccpal=0.009
    22682251            endif
    22692252
     
    22712254            if (is_master) write(*,*) "Paleo eccpal=",eccpal,"  tpal=",tpalnew
    22722255
     2256!----------------------------------------------------------------------
     2257!        Writing NetCDF file  "RESTARTFI" at the end of the run
     2258!----------------------------------------------------------------------
     2259!        Note: 'restartfi' is stored just before dynamics are stored
     2260!              in 'restart'. Between now and the writing of 'restart',
     2261!              there will have been the itau=itau+1 instruction and
     2262!              a reset of 'time' (lastacll = .true. when itau+1= itaufin)
     2263!              thus we store for time=time+dtvr
    22732264
    22742265#ifndef MESOSCALE
    22752266             ! create restartfi
    2276          if (ngrid.ne.1) then
    2277             !TODO: import this routine from pluto.old
    2278             ! call physdem1pal("restartfi.nc",long,lati,nsoilmx,nq, &
    2279             !      ptimestep,pdaypal, &
    2280             !      ztime_fin,tsurf,tsoil,emis,q2,qsurfpal, &
    2281             !      cell_area,albedodat,inertiedat,zmea,zstd,zsig, &
    2282             !      zgam,zthe,oblipal,eccpal,tpalnew,adjustnew,phisfipal,  &
    2283             !      peri_daypal)
    2284          endif
    2285       else ! 'paleo'
    2286 
    2287          if (ngrid.ne.1) then
    2288             write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin
    2289 
    2290             call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, &
    2291                           ptimestep,ztime_fin,                    &
    2292                           tsurf,tsoil,emis,q2,qsurf_hist)
    2293          endif
     2267            if (ngrid.ne.1) then
     2268               print*, "physdem1pal not yet implemented"
     2269               stop
     2270               !TODO: import this routine from pluto.old
     2271               ! call physdem1pal("restartfi.nc",long,lati,nsoilmx,nq, &
     2272               !      ptimestep,pdaypal, &
     2273               !      ztime_fin,tsurf,tsoil,emis,q2,qsurfpal, &
     2274               !      cell_area,albedodat,inertiedat,zmea,zstd,zsig, &
     2275               !      zgam,zthe,oblipal,eccpal,tpalnew,adjustnew,phisfipal,  &
     2276               !      peri_daypal)
     2277            endif
     2278         else ! 'paleo'
     2279
     2280            if (ngrid.ne.1) then
     2281               write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin
     2282
     2283               call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, &
     2284                           ptimestep,ztime_fin,                    &
     2285                           tsurf,tsoil,emis,q2,qsurf_hist)
     2286            endif
    22942287#endif
    2295       endif ! end of 'paleo'
    2296          ! if(ok_slab_ocean) then
    2297          !    call ocean_slab_final!(tslab, seaice)
    2298          ! end if
    2299 
    2300     endif ! end of 'lastcall'
     2288         endif ! end of 'paleo'
     2289      endif ! end of 'lastcall'
    23012290
    23022291
     
    23092298
    23102299
    2311          call wstats(ngrid,"ps","Surface pressure","Pa",2,ps)
    2312          call wstats(ngrid,"tsurf","Surface temperature","K",2,tsurf)
    2313          call wstats(ngrid,"fluxsurf_lw",                               &
    2314                      "Thermal IR radiative flux to surface","W.m-2",2,  &
    2315                      fluxsurf_lw)
    2316          call wstats(ngrid,"fluxtop_lw",                                &
    2317                      "Thermal IR radiative flux to space","W.m-2",2,    &
    2318                      fluxtop_lw)
    2319 
    2320 !            call wstats(ngrid,"fluxsurf_sw",                               &
    2321 !                        "Solar radiative flux to surface","W.m-2",2,       &
    2322 !                         fluxsurf_sw_tot)
    2323 !            call wstats(ngrid,"fluxtop_sw",                                &
    2324 !                        "Solar radiative flux to space","W.m-2",2,         &
    2325 !                        fluxtop_sw_tot)
    2326 
    2327 
    2328          call wstats(ngrid,"ISR","incoming stellar rad.","W m-2",2,fluxtop_dn)
    2329          call wstats(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw)
    2330          call wstats(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw)
    2331          !call wstats(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent)
    2332          !call wstats(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1))
    2333          call wstats(ngrid,"p","Pressure","Pa",3,pplay)
    2334          call wstats(ngrid,"emis","Emissivity","",2,emis)
    2335          call wstats(ngrid,"temp","Atmospheric temperature","K",3,zt)
    2336          call wstats(ngrid,"u","Zonal (East-West) wind","m.s-1",3,zu)
    2337          call wstats(ngrid,"v","Meridional (North-South) wind","m.s-1",3,zv)
    2338          call wstats(ngrid,"w","Vertical (down-up) wind","m.s-1",3,pw)
    2339          call wstats(ngrid,"q2","Boundary layer eddy kinetic energy","m2.s-2",3,q2)
    2340 
    2341          if (tracer) then
    2342             do iq=1,nq
    2343                call wstats(ngrid,noms(iq),noms(iq),'kg/kg',3,zq(1,1,iq))
    2344                call wstats(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  &
    2345                            'kg m^-2',2,qsurf(1,iq) )
    2346                call wstats(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col',    &
    2347                           'kg m^-2',2,qcol(1,iq) )
    2348 
    2349 !              call wstats(ngrid,trim(noms(iq))//'_reff',                          &
    2350 !                          trim(noms(iq))//'_reff',                                   &
    2351 !                          'm',3,reffrad(1,1,iq))
    2352 
    2353             end do
    2354 
    2355          endif ! end of 'tracer'
    2356 
    2357          !AF24: deleted slab ocean and water
    2358 
    2359          if(lastcall.and.callstats) then
    2360             write (*,*) "Writing stats..."
    2361             call mkstats(ierr)
    2362          endif
    2363 
     2300      call wstats(ngrid,"ps","Surface pressure","Pa",2,ps)
     2301      call wstats(ngrid,"tsurf","Surface temperature","K",2,tsurf)
     2302      call wstats(ngrid,"fluxsurf_lw",                               &
     2303                  "Thermal IR radiative flux to surface","W.m-2",2,  &
     2304                  fluxsurf_lw)
     2305      call wstats(ngrid,"fluxtop_lw",                                &
     2306                  "Thermal IR radiative flux to space","W.m-2",2,    &
     2307                  fluxtop_lw)
     2308
     2309      ! call wstats(ngrid,"fluxsurf_sw",                               &
     2310      !             "Solar radiative flux to surface","W.m-2",2,       &
     2311      !             fluxsurf_sw_tot)
     2312      ! call wstats(ngrid,"fluxtop_sw",                                &
     2313      !             "Solar radiative flux to space","W.m-2",2,         &
     2314      !             fluxtop_sw_tot)
     2315
     2316      call wstats(ngrid,"ISR","incoming stellar rad.","W m-2",2,fluxtop_dn)
     2317      call wstats(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw)
     2318      call wstats(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw)
     2319      ! call wstats(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent)
     2320      ! call wstats(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1))
     2321      call wstats(ngrid,"p","Pressure","Pa",3,pplay)
     2322      call wstats(ngrid,"emis","Emissivity","",2,emis)
     2323      call wstats(ngrid,"temp","Atmospheric temperature","K",3,zt)
     2324      call wstats(ngrid,"u","Zonal (East-West) wind","m.s-1",3,zu)
     2325      call wstats(ngrid,"v","Meridional (North-South) wind","m.s-1",3,zv)
     2326      call wstats(ngrid,"w","Vertical (down-up) wind","m.s-1",3,pw)
     2327      call wstats(ngrid,"q2","Boundary layer eddy kinetic energy","m2.s-2",3,q2)
     2328
     2329      if (tracer) then
     2330         do iq=1,nq
     2331            call wstats(ngrid,noms(iq),noms(iq),'kg/kg',3,zq(1,1,iq))
     2332            call wstats(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',&
     2333                        'kg m^-2',2,qsurf(1,iq) )
     2334            call wstats(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col',  &
     2335                        'kg m^-2',2,qcol(1,iq) )
     2336            call wstats(ngrid,trim(noms(iq))//'_reff',trim(noms(iq))//'_reff',&
     2337                        'm',3,reffrad(1,1,iq))
     2338         end do
     2339
     2340      endif ! end of 'tracer'
     2341
     2342      if(lastcall.and.callstats) then
     2343         write (*,*) "Writing stats..."
     2344         call mkstats(ierr)
     2345      endif
    23642346
    23652347#ifndef MESOSCALE
    23662348
    2367 !-----------------------------------------------------------------------------------------------------
    2368 !           OUTPUT in netcdf file "DIAGFI.NC", containing any variable for diagnostic
     2349!------------------------------------------------------------------------------
     2350!           OUTPUT in netcdf file "DIAGFI.NC",
     2351!           containing any variable for diagnostic
    23692352!
    23702353!             Note 1 : output with  period "ecritphy", set in "run.def"
    2371 !
    2372 !             Note 2 : writediagfi can also be called from any other subroutine for any variable,
    2373 !                      but its preferable to keep all the calls in one place ...
    2374 !-----------------------------------------------------------------------------------------------------
     2354!             Note 2 : writediagfi can also be called from any other subroutine
     2355!                      for any variable, but its preferable to keep all the
     2356!                      calls in one place ...
     2357!------------------------------------------------------------------------------
    23752358
    23762359      call writediagfi(ngrid,"Ls","solar longitude","deg",0,zls*180./pi)
     
    24542437      endif ! end of 'enertest'
    24552438
    2456         ! Diagnostics of optical thickness
    2457         ! Warning this is exp(-tau), I let you postproc with -log to have tau itself - JVO 19
    2458         if (diagdtau) then
    2459           do nw=1,L_NSPECTV
    2460             write(str2,'(i2.2)') nw
    2461             call writediagfi(ngrid,'dtauv'//str2,'Layer optical thickness attenuation in VI band '//str2,'',1,int_dtauv(:,nlayer:1:-1,nw))
    2462           enddo
    2463           do nw=1,L_NSPECTI
    2464             write(str2,'(i2.2)') nw
    2465             call writediagfi(ngrid,'dtaui'//str2,'Layer optical thickness attenuation in IR band '//str2,'',1,int_dtaui(:,nlayer:1:-1,nw))
    2466           enddo
    2467         endif
    2468 
    2469         ! Temporary inclusions for heating diagnostics.
    2470         call writediagfi(ngrid,"zdtsw","SW heating","T s-1",3,zdtsw)
    2471         call writediagfi(ngrid,"zdtlw","LW heating","T s-1",3,zdtlw)
    2472         call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad)
    2473         call writediagfi(ngrid,"zdtdyn","Dyn. heating","T s-1",3,zdtdyn)
    2474 
    2475         ! For Debugging.
    2476         !call writediagfi(ngrid,'rnat','Terrain type',' ',2,real(rnat))
    2477         !call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi)
     2439         ! Diagnostics of optical thickness
     2440         ! Warning this is exp(-tau), I let you postproc with -log to have tau itself - JVO 19
     2441         if (diagdtau) then
     2442            do nw=1,L_NSPECTV
     2443               write(str2,'(i2.2)') nw
     2444               call writediagfi(ngrid,'dtauv'//str2,'Layer optical thickness attenuation in VI band '//str2,'',1,int_dtauv(:,nlayer:1:-1,nw))
     2445            enddo
     2446            do nw=1,L_NSPECTI
     2447               write(str2,'(i2.2)') nw
     2448               call writediagfi(ngrid,'dtaui'//str2,'Layer optical thickness attenuation in IR band '//str2,'',1,int_dtaui(:,nlayer:1:-1,nw))
     2449            enddo
     2450         endif
     2451
     2452         ! Temporary inclusions for heating diagnostics.
     2453         call writediagfi(ngrid,"zdtsw","SW heating","T s-1",3,zdtsw)
     2454         call writediagfi(ngrid,"zdtlw","LW heating","T s-1",3,zdtlw)
     2455         call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad)
     2456         call writediagfi(ngrid,"zdtdyn","Dyn. heating","T s-1",3,zdtdyn)
     2457
     2458         ! For Debugging.
     2459         !call writediagfi(ngrid,'rnat','Terrain type',' ',2,real(rnat))
     2460         !call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi)
    24782461
    24792462      ! Output tracers.
     
    25252508            call writediagfi(ngrid,"zdqadj_ch4","zdqadj ch4","",&
    25262509                           3,zdqadj(:,:,igcm_ch4_gas))
    2527              if (sedimentation) then
     2510            if (sedimentation) then
    25282511               call writediagfi(ngrid,"zdqsed_ch4","zdqsed ch4","",&
    25292512                              3,zdqsed(:,:,igcm_ch4_gas))
    25302513               call writediagfi(ngrid,"zdqssed_ch4","zdqssed ch4","",&
    25312514                              2,zdqssed(:,igcm_ch4_gas))
    2532              endif
    2533              if (metcloud.and.(.not.fast)) then
     2515            endif
     2516            if (metcloud.and.(.not.fast)) then
    25342517               call writediagfi(ngrid,"zdtch4cloud","ch4 cloud","T s-1",&
    25352518                           3,zdtch4cloud)
  • trunk/LMDZ.PLUTO/libf/phypluto/suaer_corrk.F90

    r3377 r3501  
    131131      allocate(file_id(naerkind,2))
    132132
    133       if (noaero) then
    134         print*, 'naerkind= 0'
    135       endif
     133      ! if (noaero) then
     134      !   print*, 'naerkind= 0'
     135      !   naerkind=0
     136      ! endif
    136137
    137138
     
    218219               write(*,*)' http://www.lmd.jussieu.fr/',&
    219220               '~lmdz/planets/LMDZ.GENERIC/datagcm/'
    220                CALL ABORT
     221               call abort_physic("suaer_corrk",'Problem with optical properties file',1)
    221222            ENDIF
    222223
  • trunk/LMDZ.PLUTO/libf/phypluto/xios_output_mod.F90

    r3184 r3501  
    22
    33 IMPLICIT NONE
    4  
     4
    55 INTEGER,PRIVATE,SAVE :: time_it=0 ! store number of iterations with calls to XIOS since start
    66! does not need to be threadprivate; managed by omp master
    77
    88 CHARACTER(LEN=*), PARAMETER :: context_id= "LMDZ" ! same as in context_lmdz_physics.xml
    9  
     9
    1010#ifdef CPP_XIOS
    1111
     
    1313    MODULE PROCEDURE histwrite0d_xios,histwrite2d_xios,histwrite3d_xios!,histwrite1d_xios
    1414 END INTERFACE
    15  
     15
    1616
    1717CONTAINS
     
    3636  USE wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_closedef
    3737  IMPLICIT NONE
    38  
     38
    3939  REAL,INTENT(IN) :: day ! Number of elapsed sols since reference Ls=0.
    4040  REAL,INTENT(IN) :: timeofday ! "Universal time", given as fraction of sol (e.g.: 0.5 for noon).
     
    4646  REAL,INTENT(IN) :: wnoi(:) ! Array of wavenumbers at the spectral interval centers for the infrared.
    4747  real,intent(in) :: wnov (:) !Array of wavenumbers at the spectral interval centers for the visible.
    48  
     48
    4949  INTEGER :: data_ibegin, data_iend
    5050  TYPE(xios_duration) :: timestep
    5151  TYPE(xios_date) :: time_origin
    5252  TYPE(xios_date) :: start_date
    53  
     53
    5454!$OMP BARRIER
    5555!$OMP MASTER
     
    7474!    IF (mpi_rank == 0) THEN
    7575!        data_ibegin = 0
    76 !    ELSE 
     76!    ELSE
    7777!        data_ibegin = ii_begin - 1
    7878!    END IF
     
    129129    !NB: it would make more sense to define months and their length in the
    130130    ! xml files and not to have them hard coded here.... to be improved...
    131    
     131
    132132    ! time origin of the simulation (default: 1st year/1st month/1st day, Ls=0)
    133133    time_origin=xios_date(1,1,1,0,0,0)
     
    151151!$OMP END MASTER
    152152!$OMP BARRIER
    153  
     153
    154154  END SUBROUTINE initialize_xios_output
    155155
     
    159159  USE xios
    160160  IMPLICIT NONE
    161 !$OMP BARRIER   
     161!$OMP BARRIER
    162162!$OMP MASTER
    163163    CALL xios_context_finalize
    164 !$OMP END MASTER   
    165 !$OMP BARRIER   
    166  
     164!$OMP END MASTER
     165!$OMP BARRIER
     166
    167167  END SUBROUTINE finalize_xios_output
    168168
     
    176176    time_it=time_it+1
    177177    CALL xios_update_calendar(time_it)
    178 !$OMP END MASTER   
     178!$OMP END MASTER
    179179  END SUBROUTINE update_xios_timestep
    180180
     
    189189    CALL xios_get_handle(context_id,ctx_hdl)
    190190    CALL xios_set_current_context(ctx_hdl)
    191 !$OMP END MASTER   
     191!$OMP END MASTER
    192192  END SUBROUTINE set_xios_context
    193193
     
    198198  USE print_control_mod, ONLY: prt_level, lunout
    199199  IMPLICIT NONE
    200  
     200
    201201    CHARACTER(LEN=*), INTENT(IN) :: field_name
    202202    REAL, INTENT(IN) :: field
    203    
     203
    204204    IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite0d_xios ',trim(field_name)
    205    
     205
    206206!$OMP MASTER
    207207    CALL xios_send_field(field_name,field)
    208208!$OMP END MASTER
    209    
     209
    210210    IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite0d_xios ',trim(field_name)
    211    
     211
    212212  END SUBROUTINE histwrite0d_xios
    213213
     
    226226    CHARACTER(LEN=*), INTENT(IN) :: field_name
    227227    REAL, DIMENSION(:), INTENT(IN) :: field
    228      
     228
    229229    REAL,DIMENSION(klon_mpi) :: buffer_omp
    230230    REAL :: Field2d(nbp_lon,jj_nb)
    231231
    232232    IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite2d_xios ',trim(field_name)
    233     if ((size(field) .eq. L_NSPECTI) .or. (size(field) .eq. L_NSPECTV)) then 
    234 !$OMP MASTER 
     233    if ((size(field) .eq. L_NSPECTI) .or. (size(field) .eq. L_NSPECTV)) then
     234!$OMP MASTER
    235235      ! only for spectral stuff: IR_Bandwidth and VI_Bandwidth
    236236      call xios_send_field(field_name,field)
     
    239239    endif
    240240    IF (SIZE(field)/=klon) CALL abort_physic('iophy::histwrite2d_xios','Field first DIMENSION not equal to klon',1)
    241    
    242     CALL Gather_omp(field,buffer_omp)   
     241
     242    CALL Gather_omp(field,buffer_omp)
    243243!$OMP MASTER
    244244    CALL grid1Dto2D_mpi(buffer_omp,Field2d)
    245    
     245
    246246    CALL xios_send_field(field_name, Field2d)
    247 !$OMP END MASTER   
     247!$OMP END MASTER
    248248
    249249    IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite2d_xios ',trim(field_name)
     
    281281
    282282    CALL xios_send_field(field_name, Field3d(:,:,1:nlev))
    283 !$OMP END MASTER   
     283!$OMP END MASTER
    284284
    285285    IF (prt_level >= 10) write(lunout,*)'End histrwrite3d_xios ',trim(field_name)
Note: See TracChangeset for help on using the changeset viewer.