################################################################################ # # # Unless further variables or options for existing variables are introduced, # # DO NOT MODIFY this file! This is only a helper file! # # # ################################################################################ # # # This file does the actual work of selecting and reading in the RAW cloud # # data for Venus as specified by the user. For user specification use, e.g., # # DemoVenusClouds1D.arts as template. The template also contains the detailed # # information on which indices are linked to which specific value/selection # # for each of the variables. The full arrays, which the indices refer to and # # from which the actual values are extracted, are defined in clouds_venus.arts # # (hence, clouds_venus.arts needs to be included before the file at hand). # # # # This file expects the following input parameters: # # pndcase (Index) The cloud field scenario. # # cloudtypes (ArrayOfIndex) The cloud layers to be considered. # # # # Files to be included before this file: # # includes/venus/clouds_venus.arts # # includes/common/createvars.arts # # # # It provides no direct output, but stores the output in temporary files # # (which will the be processed into their final variable containers by # # makeclouds1D.arts). This externally stored output is: # # pnd_field_raw as the WSV # # ssdfiles (ArrayOfString) List of files containing the single # # scattering data for each particle type. # # The list serves as input parameter # # scat_data_files to WSM # # ScatSpeciesPndAndScatAdd. # # Names of the temporary files are passed into makeclouds1D.arts by the String # # variables # # pndtmp for pnd_field_raw file # # poptmp for ssdfiles # # # ################################################################################ Arts2 { # We will need to dummy-store some data in files to be able to export data from # forloops. So we create some dummy names. #StringSet( tmpformat, "ascii" ) StringSet( tmpformat, "binary" ) StringSet( pndtmp, "tmp1.xml" ) StringSet( poptmp, "tmp2.xml" ) ArrayOfIndexCreate( typesinlayerarray ) # Loop agenda to get pnd & ssd data of all modes in a cloud layer AgendaCreate( modeloop_agenda ) AgendaSet( modeloop_agenda ){ ReadXML( out=pnd_field_raw, filename=pndtmp ) ReadXML( out=ssdfiles, filename=poptmp ) Extract( itmp, typesinlayerarray, forloop_index ) Extract( strtmp, cloudtypearray, itmp ) Append( pndstr, strtmp ) Append( ssdstr, strtmp ) Extract( strtmp, pndarray, pndcase ) Append( pndstr, strtmp ) Print( pndstr, 0 ) ReadXML( aogf3tmp, pndstr ) Append( pnd_field_raw, aogf3tmp ) WriteXML( output_file_format=tmpformat, in=pnd_field_raw, filename=pndtmp ) Append( ssdstr, ssdpostname ) Print( ssdstr, 0 ) Append( ssdfiles, ssdstr ) WriteXML( output_file_format=tmpformat, in=ssdfiles, filename=poptmp ) } # Loop agenda to get pnd & ssd data per cloud layer AgendaCreate( layerloop_agenda ) AgendaSet( layerloop_agenda ){ Extract( itmp, cloudtypes, forloop_index ) Extract( typesinlayerarray, layer2typearray, itmp ) nelemGet( ncases, typesinlayerarray ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, modeloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) } # Get the cloud pnd field and single scattering data # --- # first, create the casename string down to the common filename part in the # scenario folder. Data is located in: # Venus.atmo/ Copy( pndstr, cloudbase ) Extract( subatmo, atmoarray, atmo ) Append( pndstr, subatmo ) StringSet( strtmp, "/" ) Append( pndstr, strtmp ) Append( pndstr, subatmo ) StringSet( strtmp, "." ) Append( pndstr, strtmp ) Append( pndstr, pndprename ) Copy( ssdstr, cloudbase ) Append( ssdstr, ssdprename ) StringSet( infostr, "Cloud profile data (pnd_field) taken from: " ) Append( infostr, pndstr ) StringSet( strtmp, "*" ) Append( infostr, strtmp ) Print( infostr ) # second, we construct the name for the specific data files one-by-one, read the # pnd field data and construct pnd_field_raw (array of pnd fields), and store # the ssd file names as array in a file. This in order to later use # ScatSpeciesPndAndScatAdd to actually get the respective data into the pnd_field_raw # and scat_data ARTS WSV. Compared to directly putting the individual pnd # field and single scattering data array entries into the WSV one-by-one, this # is advantageous as (1) we do not need to read & write the scat_data # over and over to get the data out of the ForLoop (saves time) and (2) # some basic checks (covering f_grid, correct atmospheric dimension) will be # performed on scat_data and pnd_field_raw. Touch( pnd_field_raw ) Touch( ssdfiles ) WriteXML( output_file_format=tmpformat, in=pnd_field_raw, filename=pndtmp ) WriteXML( output_file_format=tmpformat, in=ssdfiles, filename=poptmp ) # third, we loop over the included cloud layers/cloud types. nelemGet( ncases, cloudtypes ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, layerloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) # all the rest is now done from makeclouds*.arts }