################################################################################ # # # 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 # # magnetic field data for Jupiter as specified by the user. For user # # specification use, e.g., DemoJupiterAtmo3D.arts (or its 1D equivalent) 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 atmo_mars.arts (hence, # # atmo_mars.arts needs to be included before the file at hand). # # # # This file expects the following input parameters: # # atmo (Index) The atmospheric scenario. # # Bcase (ArrayOfIndex) Magnetic field setup selected # # (off/Khurana). # # # # Files to be included before this file: # # includes/jupiter/atmo_jupiter.arts # # includes/common/createvars.arts # # # # It provides following output: # # mag_u/v/w_raw (GriddedField3) raw versions of mag_u/v/w_field # # # ################################################################################ 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( Btmp, "tmp1.xml" ) # Create a dummy file with empty magfield data (because regardless of whether # there actually IS data, we are going to read the storage dummy at least once. # so we need to create an empty version first.) Touch( aogf3tmp ) #this in case aogf3tmp hasn't been used before Delete( aogf3tmp ) #this to throw away possible data in aogf3tmp (if it was used before) Touch( gf3tmp ) #this in case gf3tmp hasn't been used before Delete( gf3tmp ) #this to throw away possible data in gf3tmp (if it was used before) Touch( gf3tmp ) #this to initialize it again after deleting Append( aogf3tmp, gf3tmp ) Append( aogf3tmp, gf3tmp ) Append( aogf3tmp, gf3tmp ) # this to have a properly formated file to read after the forloops WriteXML( output_file_format=tmpformat, in=aogf3tmp, filename=Btmp ) # Get data for one magfield component AgendaCreate( Bcomploop_agenda ) AgendaSet( Bcomploop_agenda ){ ReadXML( out=aogf3tmp, filename=Btmp ) Extract( strtmp, Bcomparray, forloop_index ) Append( specfilename, strtmp ) # Print( specfilename, 0 ) ReadXML( gf3tmp, specfilename ) Append( aogf3tmp, gf3tmp ) WriteXML( output_file_format=tmpformat, in=aogf3tmp, filename=Btmp ) } # Get data for the magfield case, looping over the components AgendaCreate( Bloop_agenda ) AgendaSet( Bloop_agenda ){ Touch( aogf3tmp ) WriteXML( output_file_format=tmpformat, in=aogf3tmp, filename=Btmp ) Extract( specfilename, casearray, forloop_index ) nelemGet( ncases, Bcomparray ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, Bcomploop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) } # Read the atmospheric setup # --- # (1) Magnetic Field Select( casearray, Barray, Bcase ) nelemGet( ncases, casearray ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, Bloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) ReadXML( out=aogf3tmp, filename=Btmp ) Extract( mag_w_raw, aogf3tmp, 3 ) Extract( mag_v_raw, aogf3tmp, 4 ) Extract( mag_u_raw, aogf3tmp, 5 ) # and we clean up the dummy files (not completely, though. but we write an empty # variable into them.) Delete( strtmp ) Touch( strtmp ) WriteXML( output_file_format=tmpformat, in=strtmp, filename=Btmp ) }