subroutine lymalpha(pls,pflux) use datafile_mod use comcstfi_mod, only: pi use mod_phys_lmdz_para, only : is_master implicit none !================================================================== ! Purpose ! ------- ! Get the lyman alpha flux according to the solar longitude ! ! Inputs ! ------ ! pls solar longitude ! ! Outputs ! ------- ! ! Both ! ---- ! ! Authors ! ------- ! Tanguy Bertrand !================================================================== !----------------------------------------------------------------------- ! Arguments REAL,INTENT(IN) :: pls REAL,INTENT(OUT) :: pflux !----------------------------------------------------------------------- ! Local variables REAL :: vectls REAL :: vectflux LOGICAL,SAVE :: firstcall=.true. !$OMP THREADPRIVATE(firstcall) !!read lyman alpha flux integer Nfine parameter(Nfine=13281) integer ifine character(len=100) :: file_path ! real,save :: lsdat(Nfine),fluxdat(Nfine) real,save,allocatable :: lsdat(:) real,save,allocatable :: fluxdat(:) !---------------- INPUT ------------------------------------------------ IF (firstcall) then firstcall=.false. !$OMP MASTER file_path=trim(datadir)//'/sol_uv_flux.txt' if (is_master) print*,file_path open(222,file=file_path,form='formatted') if(.not.allocated(lsdat)) then allocate(lsdat(Nfine)) endif if(.not.allocated(fluxdat)) then allocate(fluxdat(Nfine)) endif do ifine=1,Nfine read(222,*) lsdat(ifine), fluxdat(ifine) enddo close(222) !$OMP END MASTER !$OMP BARRIER ENDIF CALL interp_line(lsdat,fluxdat,Nfine,pls*180./pi,pflux,1) !if (is_master) write(*,*) 'flux=',pflux end subroutine lymalpha