c kspectrum (http://www.meso-star.com/en_Products.html) - This file is part of kspectrum c Copyright (C) 2008-2015 - Méso-Star - Vincent Eymet c c This file must be used under the terms of the CeCILL license. c This source file is licensed as described in the file COPYING, which c you should have received as part of this distribution. The terms c are also available at c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt c subroutine write_bandk_tmp(Nb,band,nu_low,nu_hi,m,i,nk,nu, & Nmol,band_sigma,band_k, & band_dsigma_dP,band_dsigma_dT,band_dsigma_dx, & band_dk_dP,band_dk_dT,band_dk_dx) implicit none c c Purpose: to write the temporary array of k coefficients into the appropriate file c c Inputs: c + Nb: number of narrowbands c + band: index of the narrowband to discretize c + nu_low: lower limit of each narrowband [cm¯¹] c + nu_hi: upper limit of each narrowband [cm¯¹] c + m : number of atmospheric levels c + i: index of the atmospheric level c + nk: number of wavenumber values in the band c + nu: array of wavenumber values [cm¯¹] c + Nmol: number of molecules c + band_sigma: temporary array of cross-section values [cm²/molecule] c + band_k: temporary array of k values [m¯¹] c + band_sigma & band_k: temporary results in the case of multipass computations c + band_dsigma* & band_dk*: temporary results in the case of multipass computations c include 'max.inc' include 'formats.inc' integer Nb,band,m,i,mol double precision nu_low(1:Nbmx) double precision nu_hi(1:Nbmx) integer nk,ik double precision nu(1:Nkmx) integer Nmol double precision band_sigma(1:Nkmx) double precision band_k(1:Nkmx) double precision band_dsigma_dP(1:Nkmx) double precision band_dsigma_dT(1:Nkmx) double precision band_dsigma_dx(1:Nkmx,1:Nmol_max) double precision band_dk_dP(1:Nkmx) double precision band_dk_dT(1:Nkmx) double precision band_dk_dx(1:Nkmx,1:Nmol_max) character*(Nchar_mx) kfile c label integer strlen character*(Nchar_mx) label label='subroutine write_bandk_tmp' call result_file_name_tmp(i,band,kfile) open(11,file=kfile(1:strlen(kfile))) do ik=1,nk write(11,52) nu(ik),band_sigma(ik),band_k(ik), & band_dsigma_dP(ik),band_dsigma_dT(ik), & (band_dsigma_dx(ik,mol),mol=1,Nmol), & band_dk_dP(ik),band_dk_dT(ik), & (band_dk_dx(ik,mol),mol=1,Nmol) enddo close(11) return end subroutine result_file_name_tmp(i,band,kfile) implicit none include 'max.inc' include 'formats.inc' integer i,band character*3 kch character*(Nchar_mx) base,kfile,kf c label integer strlen character*(Nchar_mx) label label='subroutine result_file_name_tmp' base='./optimizations/' call num2str3(i,kch) kf='k'//kch(1:strlen(kch)) kfile=base(1:strlen(base))//kf(1:strlen(kf))//'_' call num2str3(band,kch) kf='band'//kch(1:strlen(kch)) kfile=kfile(1:strlen(kfile))//kf(1:strlen(kf))//'_tmp' return end