Home > atmlab > arts_usage > qarts_add_mars_planettbox.m

qarts_add_mars_planettbox

PURPOSE ^

QARTS_ADD_MARS_PLANETTBOX Includes planet toolbox study data for Mars

SYNOPSIS ^

function Q = qarts_add_mars_planettbox( A, Q, workfolder )

DESCRIPTION ^

 QARTS_ADD_MARS_PLANETTBOX   Includes planet toolbox study data for Mars

  This function works as an interface to the data for the planet Mars 
  gathered during the ESA study, where ARTS was extended to cover other
  planets.

  Q.ATMOSPHERE_DIM must be set and determines if a 1D or 3D atmosphere is
  created (2D is not handled).

  The following fields are mandatory:
    A.Ls
    A.daytime
    A.dust
    A.solar
    A.interp_order
    A.basespecies
    A.ch4species
    A.h2ospecies
    A.Necase
  These variables and possible settings are described in the file 
  arts/controlfiles/planetary_toolbox/DemoMarsAtmo1D.arts.

  All "zeropadding" variables are hard-coded to 1.

  Wind fields are included by setting A.wind_u, A.wind_v and A.wind_w
  to true, respectively. Default is false.
  
  The atmospheric grids can be cropped by the following (also mandatory) 
  fields:
    A.pmin
    A.latmin   (not needed for 1D)
    A.latmax   (not needed for 1D)
    A.lonmin   (not needed for 1D)
    A.lonmax   (not needed for 1D)
  Grid points outside these values are removed (pmax hard-coded to a very
  high value). Longitude limits can be inside [-360,360]. 

 FORMAT Q = qarts_add_mars_planettbox( A, Q, workfolder )

 OUT   Q          Modified Q
 IN    A          Atmosphere structure, see above.
       Q          Original Q
       workfolder Path to workfolder (not used, but an input is demanded)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

qarts_add_mars_planettbox.m

SOURCE CODE ^

0001 % QARTS_ADD_MARS_PLANETTBOX   Includes planet toolbox study data for Mars
0002 %
0003 %  This function works as an interface to the data for the planet Mars
0004 %  gathered during the ESA study, where ARTS was extended to cover other
0005 %  planets.
0006 %
0007 %  Q.ATMOSPHERE_DIM must be set and determines if a 1D or 3D atmosphere is
0008 %  created (2D is not handled).
0009 %
0010 %  The following fields are mandatory:
0011 %    A.Ls
0012 %    A.daytime
0013 %    A.dust
0014 %    A.solar
0015 %    A.interp_order
0016 %    A.basespecies
0017 %    A.ch4species
0018 %    A.h2ospecies
0019 %    A.Necase
0020 %  These variables and possible settings are described in the file
0021 %  arts/controlfiles/planetary_toolbox/DemoMarsAtmo1D.arts.
0022 %
0023 %  All "zeropadding" variables are hard-coded to 1.
0024 %
0025 %  Wind fields are included by setting A.wind_u, A.wind_v and A.wind_w
0026 %  to true, respectively. Default is false.
0027 %
0028 %  The atmospheric grids can be cropped by the following (also mandatory)
0029 %  fields:
0030 %    A.pmin
0031 %    A.latmin   (not needed for 1D)
0032 %    A.latmax   (not needed for 1D)
0033 %    A.lonmin   (not needed for 1D)
0034 %    A.lonmax   (not needed for 1D)
0035 %  Grid points outside these values are removed (pmax hard-coded to a very
0036 %  high value). Longitude limits can be inside [-360,360].
0037 %
0038 % FORMAT Q = qarts_add_mars_planettbox( A, Q, workfolder )
0039 %
0040 % OUT   Q          Modified Q
0041 % IN    A          Atmosphere structure, see above.
0042 %       Q          Original Q
0043 %       workfolder Path to workfolder (not used, but an input is demanded)
0044 
0045 % 2013-10-03   Created by Patrick Eriksson.
0046 
0047 function Q = qarts_add_mars_planettbox( A, Q, workfolder )
0048 %
0049 rqre_datatype( A, { @isstruct } );
0050 rqre_datatype( Q, { @isstruct, @ischar } );
0051 rqre_datatype( workfolder, { @ischar,@isempty } );
0052 
0053 
0054 arts_xmldata_path       = atmlab( 'ARTS_XMLDATA_PATH' );
0055 if isnan( arts_xmldata_path )
0056   error('You need to set ARTS_XMLDATA_PATH to use this function.');
0057 end
0058 
0059 
0060 % Create the variables used by getatmo_mars.arts
0061 %
0062 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( Ls )';
0063 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( daytime )';
0064 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( dust )';
0065 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( solar )';
0066 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( basespecies )';
0067 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( h2ospecies )';
0068 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( ch4species )';
0069 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( Necase )';
0070 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( vertwind )';
0071 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( NSwind )';
0072 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( EWwind )';
0073 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( latmin )';
0074 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( latmax )';
0075 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( lonmin )';
0076 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( lonmax )';
0077 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( auxfield_zeropad )';
0078 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( vmr_zeropad )';
0079 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( interp_order )';
0080 
0081 
0082 % Set the variables above
0083 %
0084 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( Ls, %d )',      A.Ls      );
0085 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( daytime, %d )', A.daytime );
0086 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( dust, %d )',    A.dust    );
0087 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( solar, %d )',   A.solar   );
0088 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( interp_order, %d )',  ...
0089                                                               A.interp_order );
0090 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( vmr_zeropad, %d )', 1 );
0091 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( auxfield_zeropad, %d )', 1 );
0092 %
0093 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0094    'ArrayOfIndexSet( basespecies, [%s] )', vector2commalist( A.basespecies ) );
0095 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0096      'ArrayOfIndexSet( ch4species, [%s] )', vector2commalist( A.ch4species ) );
0097 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0098      'ArrayOfIndexSet( h2ospecies, [%s] )', vector2commalist( A.h2ospecies ) );
0099 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0100              'ArrayOfIndexSet( Necase, [%s] )', vector2commalist( A.Necase ) );
0101 
0102 Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0103                  'INCLUDE "planetary_toolbox/includes/common/createvars.arts"';
0104 Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0105                     'INCLUDE "planetary_toolbox/includes/mars/atmo_mars.arts"';
0106 Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0107                  'INCLUDE "planetary_toolbox/includes/mars/getatmo_mars.arts"';
0108 
0109 % Set pmin and pmax
0110 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( pmin, %d )', A.pmin );
0111 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( pmax, %d )', 1e99 );
0112 
0113 
0114 if Q.ATMOSPHERE_DIM == 1
0115   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0116                  'INCLUDE "planetary_toolbox/includes/common/getgrids_1D.arts"';
0117   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0118                  'INCLUDE "planetary_toolbox/includes/common/makeatmo1D.arts"';
0119 elseif Q.ATMOSPHERE_DIM == 3
0120   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( latmin, %d )', ...
0121                                                                    A.latmin );
0122   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( latmax, %d )', ...
0123                                                                    A.latmax );
0124   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( lonmin, %d )', ...
0125                                                                    A.lonmin );
0126   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( lonmax, %d )', ...
0127                                                                    A.lonmax );
0128   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0129                  'INCLUDE "planetary_toolbox/includes/common/getgrids_3D.arts"';
0130   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0131                  'INCLUDE "planetary_toolbox/includes/common/makeatmo3D.arts"';
0132 else
0133   error( 'Only 1D and 3D atmosphere can be generated.' );
0134 end
0135 
0136 
0137 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexSet( vertwind, [0] )';
0138 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexSet( EWwind, [0] )';
0139 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexSet( NSwind, [0] )';
0140 
0141 u_wind = safegetfield( A, 'wind_u', 0 );
0142 v_wind = safegetfield( A, 'wind_v', 0 );
0143 w_wind = safegetfield( A, 'wind_w', 0 );
0144 
0145 if u_wind | v_wind | w_wind
0146   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0147                  'INCLUDE "planetary_toolbox/includes/mars/getwind_mars.arts"';
0148   if u_wind 
0149     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( rawfield, wind_u_raw )';
0150     if Q.ATMOSPHERE_DIM == 1
0151       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0152                 'INCLUDE "planetary_toolbox/includes/common/makefield1D.arts"';
0153     else
0154       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0155                 'INCLUDE "planetary_toolbox/includes/common/makefield3D.arts"';
0156     end
0157     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( wind_u_field, finalfield )';
0158   end
0159   if v_wind 
0160     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( rawfield, wind_v_raw )';
0161     if Q.ATMOSPHERE_DIM == 1
0162       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0163                 'INCLUDE "planetary_toolbox/includes/common/makefield1D.arts"';
0164     else
0165       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0166                 'INCLUDE "planetary_toolbox/includes/common/makefield3D.arts"';
0167     end
0168     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( wind_v_field, finalfield )';
0169   end
0170   if w_wind 
0171     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( rawfield, wind_w_raw )';
0172     if Q.ATMOSPHERE_DIM == 1
0173       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0174                 'INCLUDE "planetary_toolbox/includes/common/makefield1D.arts"';
0175     else
0176       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0177                 'INCLUDE "planetary_toolbox/includes/common/makefield3D.arts"';
0178     end
0179     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( wind_w_field, finalfield )';
0180   end
0181 end
0182 
0183 
0184 
0185

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005