Ignore:
Timestamp:
Nov 8, 2024, 10:57:14 AM (13 days ago)
Author:
afalco
Message:

Pluto: print only on master process.
AF

File:
1 edited

Legend:

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

    r3184 r3504  
    22
    33!==================================================================
    4 !     
     4!
    55!     Purpose
    66!     -------
    7 !     Set up spectral intervals, stellar spectrum and Rayleigh 
    8 !     opacity in the shortwave. 
    9 !     
     7!     Set up spectral intervals, stellar spectrum and Rayleigh
     8!     opacity in the shortwave.
     9!
    1010!     Authors
    11 !     ------- 
     11!     -------
    1212!     Adapted from setspv in the NASA Ames radiative code by
    1313!     Robin Wordsworth (2009).
     
    1616!     ---------
    1717!     callcorrk.F
    18 !     
     18!
    1919!     Calls
    2020!     -----
    2121!     ave_stelspec.F
    22 !     
     22!
    2323!==================================================================
    2424
     
    2828      use datafile_mod, only: datadir
    2929      use callkeys_mod, only: Fat1AU,rayleigh
     30      use mod_phys_lmdz_para, only : is_master
    3031
    3132      implicit none
     
    5354
    5455      write(temp1,'(i2.2)') L_NSPECTV
    55       file_id='/corrk_data/'//trim(adjustl(banddir))//'/narrowbands_VI.in' 
     56      file_id='/corrk_data/'//trim(adjustl(banddir))//'/narrowbands_VI.in'
    5657      file_path=TRIM(datadir)//TRIM(file_id)
    5758
     
    6566         write(*,*)' datadir = /absolute/path/to/datagcm'
    6667         write(*,*)'Also check that the corrkdir you chose in callphys.def exists.'
    67          call abort
     68         call abort_physic("setspv", "File not found by setspi", 1)
    6869      endif
    69        
    70 !$OMP MASTER       
     70
     71!$OMP MASTER
    7172      nb=0
    7273      ierr=0
    73       ! check that the file contains the right number of bands 
     74      ! check that the file contains the right number of bands
    7475      open(131,file=file_path,form='formatted')
    7576      read(131,*,iostat=ierr) file_entries
     
    8081      close(131)
    8182
    82       write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model '
    83       write(*,*) '        there are   ',nb, 'entries in ',TRIM(file_path)
     83      if (is_master) then
     84         write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model '
     85         write(*,*) '        there are   ',nb, 'entries in ',TRIM(file_path)
     86      endif
    8487      if(nb.ne.L_NSPECTV) then
    85          write(*,*) 'MISMATCH !! I stop here'
    86          call abort
     88         call abort_physic("setspv",'MISMATCH !! I stop here',1)
    8789      endif
    8890
    8991      ! load and display the data
    9092      open(111,file=file_path,form='formatted')
    91       read(111,*) 
     93      read(111,*)
    9294       do M=1,L_NSPECTV-1
    9395         read(111,*) BWNV(M)
     
    100102!$OMP BARRIER
    101103
    102       print*,'setspv: VI band limits:'
    103       do M=1,L_NSPECTV+1
    104          print*,m,'-->',BWNV(M),' cm^-1'
    105       end do
    106       print*,' '
     104      if (is_master) then
     105         print*,'setspv: VI band limits:'
     106         do M=1,L_NSPECTV+1
     107            print*,m,'-->',BWNV(M),' cm^-1'
     108         end do
     109         print*,' '
     110      endif
    107111
    108 !     Set up mean wavenumbers and wavenumber deltas.  Units of 
     112!     Set up mean wavenumbers and wavenumber deltas.  Units of
    109113!     wavenumbers is cm^(-1); units of wavelengths is microns.
    110114
     
    121125!     Set up stellar spectrum
    122126
    123       write(*,*)'setspv: Interpolating stellar spectrum from the hires data...'
     127      if (is_master) write(*,*)'setspv: Interpolating stellar spectrum from the hires data...'
    124128      call ave_stelspec(STELLAR)
    125129
    126 !     Sum the stellar flux, and write out the result. 
    127       sum = 0.0 
     130!     Sum the stellar flux, and write out the result.
     131      sum = 0.0
    128132      do N=1,L_NSPECTV
    129133         STELLARF(N) = STELLAR(N) * Fat1AU
    130134         sum         = sum+STELLARF(N)
    131135      end do
    132       write(6,'("setspv: Stellar flux at 1 AU = ",f9.2," W m-2")') sum
    133       print*,' '
     136      if (is_master)then
     137         write(6,'("setspv: Stellar flux at 1 AU = ",f9.2," W m-2")') sum
     138         print*,' '
     139      endif
    134140
    135141
     
    142148         call calc_rayleigh
    143149      else
    144          print*,'setspv: No Rayleigh scattering, check for NaN in output!'
     150         if (is_master) print*,'setspv: No Rayleigh scattering, check for NaN in output!'
    145151         do N=1,L_NSPECTV
    146152            TAURAY(N) = 1E-16
Note: See TracChangeset for help on using the changeset viewer.