Ignore:
Timestamp:
Apr 19, 2022, 12:03:01 PM (3 years ago)
Author:
dbardet
Message:

Using of is_master keyword to allow nly the master processor to write the messages and avoid too heavy output files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateCH4CH4.F90

    r2655 r2662  
    1616  use callkeys_mod, only: strictboundcia
    1717  use datafile_mod, only: datadir
     18  use mod_phys_lmdz_para, only : is_master
     19
    1820  implicit none
    1921
     
    5759  if(temp.gt.400)then
    5860    if (strictboundcia) then
    59       print*,'Your temperatures are too high for this CH4-CH4 CIA dataset.'
    60       print*,'Please run mixed CH4-CH4 atmospheres below T = 400 K.'     
     61      if (is_master) then
     62        print*,'Your temperatures are too high for this CH4-CH4 CIA dataset.'
     63        print*,'Please run mixed CH4-CH4 atmospheres below T = 400 K.'     
     64      endif
    6165      stop
    6266    else
    63       print*,'Your temperatures are too high for this CH4-CH4 CIA dataset'
    64       print*,'you have chosen strictboundcia = ', strictboundcia
    65       print*,'*********************************************************'
    66       print*,' we allow model to continue but with temp = 400          '
    67       print*,'  ...       for CH4-CH4 CIA dataset        ...           '
    68       print*,'  ... we assume we know what you are doing ...           '
    69       print*,'*********************************************************'
     67      if (is_master) then
     68        print*,'Your temperatures are too high for this CH4-CH4 CIA dataset'
     69        print*,'you have chosen strictboundcia = ', strictboundcia
     70        print*,'*********************************************************'
     71        print*,' we allow model to continue but with temp = 400          '
     72        print*,'  ...       for CH4-CH4 CIA dataset        ...           '
     73        print*,'  ... we assume we know what you are doing ...           '
     74        print*,'*********************************************************'
     75      endif
    7076      temp = 400
    7177    endif
    7278  elseif(temp.lt.40)then
    7379    if (strictboundcia) then
    74       print*,'Your temperatures are too low for this CH4-CH4 CIA dataset.'
    75       print*,'Please run mixed CH4-CH4 atmospheres above T = 40 K.'     
     80      if (is_master) then
     81        print*,'Your temperatures are too low for this CH4-CH4 CIA dataset.'
     82        print*,'Please run mixed CH4-CH4 atmospheres above T = 40 K.'     
     83      endif
    7684      stop
    7785    else
    78       print*,'Your temperatures are too low for this CH4-CH4 CIA dataset'
    79       print*,'you have chosen strictboundcia = ', strictboundcia
    80       print*,'*********************************************************'
    81       print*,' we allow model to continue but with temp = 40           '
    82       print*,'  ...       for CH4-CH4 CIA dataset        ...           '
    83       print*,'  ... we assume we know what you are doing ...           '
    84       print*,'*********************************************************'
     86      if (is_master) then
     87        print*,'Your temperatures are too low for this CH4-CH4 CIA dataset'
     88        print*,'you have chosen strictboundcia = ', strictboundcia
     89        print*,'*********************************************************'
     90        print*,' we allow model to continue but with temp = 40           '
     91        print*,'  ...       for CH4-CH4 CIA dataset        ...           '
     92        print*,'  ... we assume we know what you are doing ...           '
     93        print*,'*********************************************************'
     94      endif
    8595      temp = 40
    8696    endif
     
    90100
    91101  if(firstcall)then ! called by sugas_corrk only
    92      print*,'----------------------------------------------------'
    93      print*,'Initialising CH4-CH4 continuum from HITRAN database...'
     102     if (is_master) print*,'----------------------------------------------------'
     103     if (is_master) print*,'Initialising CH4-CH4 continuum from HITRAN database...'
    94104
    95105     !     1.1 Open the ASCII files
     
    99109     open(33,file=dt_file,form='formatted',status='old',iostat=ios)
    100110     if (ios.ne.0) then        ! file not found
    101         write(*,*) 'Error from interpolateCH4CH4'
    102         write(*,*) 'Data file ',trim(dt_file),' not found.'
    103         write(*,*) 'Check that your path to datagcm:',trim(datadir)
    104         write(*,*) 'is correct. You can change it in callphys.def with:'
    105         write(*,*) 'datadir = /absolute/path/to/datagcm'
    106         write(*,*) 'Also check that the continuum data continuum_data/CH4-CH4_2011.cia is there.'
     111        if (is_master) then
     112          write(*,*) 'Error from interpolateCH4CH4'
     113          write(*,*) 'Data file ',trim(dt_file),' not found.'
     114          write(*,*) 'Check that your path to datagcm:',trim(datadir)
     115          write(*,*) 'is correct. You can change it in callphys.def with:'
     116          write(*,*) 'datadir = /absolute/path/to/datagcm'
     117          write(*,*) 'Also check that the continuum data continuum_data/CH4-CH4_2011.cia is there.'
     118        endif
    107119        call abort
    108120     else
     
    112124           read(33,fmat1) bleh,blah,blah,nres,Ttemp
    113125           if(nS.ne.nres)then
    114               print*,'Resolution given in file: ',trim(dt_file)
    115               print*,'is ',nres,', which does not match nS.'
    116               print*,'Please adjust nS value in interpolateCH4CH4.F90'
     126              if (is_master) then
     127                print*,'Resolution given in file: ',trim(dt_file)
     128                print*,'is ',nres,', which does not match nS.'
     129                print*,'Please adjust nS value in interpolateCH4CH4.F90'
     130              endif
    117131              stop
    118132           endif
     
    129143!$OMP END MASTER
    130144!$OMP BARRIER
    131 
    132      print*,'interpolateCH4CH4: At wavenumber ',wn,' cm^-1'
    133      print*,'   temperature                 ',temp,' K'
    134      print*,'   pressure                    ',pres,' Pa'
    135 
     145     if (is_master) then
     146       print*,'interpolateCH4CH4: At wavenumber ',wn,' cm^-1'
     147       print*,'   temperature                 ',temp,' K'
     148       print*,'   pressure                    ',pres,' Pa'
     149     endif
    136150  endif
    137151
Note: See TracChangeset for help on using the changeset viewer.