Home > atmlab > arts_usage > qarts_add_venus_planettbox.m

qarts_add_venus_planettbox

PURPOSE ^

QARTS_ADD_VENUS_PLANETTBOX Includes planet toolbox study data for Venus

SYNOPSIS ^

function Q = qarts_add_venus_planettbox( A, Q, workfolder )

DESCRIPTION ^

 QARTS_ADD_VENUS_PLANETTBOX   Includes planet toolbox study data for Venus

  This function works as an interface to the data for the planet Venus
  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.atmo
    A.basespecies
    A.h2ospecies
    A.hdospecies
    A.Necase
  These variables and possible settings are described in the file 
  arts/controlfiles/planetary_toolbox/DemoVenusAtmo1D.arts.

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

  Wind fields are included by setting A.wind_u and A.wind_v to true,
  respectively. Default is false. Vertical winds are not handled.
  
  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_venus_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_venus_planettbox.m

SOURCE CODE ^

0001 % QARTS_ADD_VENUS_PLANETTBOX   Includes planet toolbox study data for Venus
0002 %
0003 %  This function works as an interface to the data for the planet Venus
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.atmo
0012 %    A.basespecies
0013 %    A.h2ospecies
0014 %    A.hdospecies
0015 %    A.Necase
0016 %  These variables and possible settings are described in the file
0017 %  arts/controlfiles/planetary_toolbox/DemoVenusAtmo1D.arts.
0018 %
0019 %  All "zeropadding" variables are hard-coded to 1.
0020 %
0021 %  Wind fields are included by setting A.wind_u and A.wind_v to true,
0022 %  respectively. Default is false. Vertical winds are not handled.
0023 %
0024 %  The atmospheric grids can be cropped by the following (also mandatory)
0025 %  fields:
0026 %    A.pmin
0027 %    A.latmin   (not needed for 1D)
0028 %    A.latmax   (not needed for 1D)
0029 %    A.lonmin   (not needed for 1D)
0030 %    A.lonmax   (not needed for 1D)
0031 %  Grid points outside these values are removed (pmax hard-coded to a very
0032 %  high value). Longitude limits can be inside [-360,360].
0033 %
0034 % FORMAT Q = qarts_add_venus_planettbox( A, Q, workfolder )
0035 %
0036 % OUT   Q          Modified Q
0037 % IN    A          Atmosphere structure, see above.
0038 %       Q          Original Q
0039 %       workfolder Path to workfolder (not used, but an input is demanded)
0040 
0041 % 2013-10-03   Created by Patrick Eriksson.
0042 
0043 function Q = qarts_add_venus_planettbox( A, Q, workfolder )
0044 %
0045 rqre_datatype( A, { @isstruct } );
0046 rqre_datatype( Q, { @isstruct, @ischar } );
0047 rqre_datatype( workfolder, { @ischar,@isempty } );
0048 
0049 
0050 arts_xmldata_path       = atmlab( 'ARTS_XMLDATA_PATH' );
0051 if isnan( arts_xmldata_path )
0052   error('You need to set ARTS_XMLDATA_PATH to use this function.');
0053 end
0054 
0055 
0056 % Create the variables used by getatmo_venus.arts
0057 %
0058 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( atmo )';
0059 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( basespecies )';
0060 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( h2ospecies )';
0061 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( hdospecies )';
0062 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( Necase )';
0063 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( NSwind )';
0064 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexCreate( EWwind )';
0065 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( latmin )';
0066 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( latmax )';
0067 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( lonmin )';
0068 Q.WSMS_BEFORE_ATMSURF{end+1} = 'NumericCreate( lonmax )';
0069 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( auxfield_zeropad )';
0070 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( vmr_zeropad )';
0071 Q.WSMS_BEFORE_ATMSURF{end+1} = 'IndexCreate( interp_order )';
0072 
0073 
0074 % Set the variables above
0075 %
0076 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( atmo, %d )',    A.atmo    );
0077 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( auxfield_zeropad, %d )', 1 );
0078 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( vmr_zeropad, %d )', 1 );
0079 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'IndexSet( interp_order, %d )',  ...
0080                                                               A.interp_order );
0081 %
0082 %
0083 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0084    'ArrayOfIndexSet( basespecies, [%s] )', vector2commalist( A.basespecies ) );
0085 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0086      'ArrayOfIndexSet( h2ospecies, [%s] )', vector2commalist( A.h2ospecies ) );
0087 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0088      'ArrayOfIndexSet( hdospecies, [%s] )', vector2commalist( A.hdospecies ) );
0089 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( ...
0090              'ArrayOfIndexSet( Necase, [%s] )', vector2commalist( A.Necase ) );
0091 
0092 Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0093                  'INCLUDE "planetary_toolbox/includes/common/createvars.arts"';
0094 Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0095                   'INCLUDE "planetary_toolbox/includes/venus/atmo_venus.arts"';
0096 Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0097                'INCLUDE "planetary_toolbox/includes/venus/getatmo_venus.arts"';
0098 
0099 
0100 % Set pmin and pmax
0101 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( pmin, %d )', A.pmin );
0102 Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( pmax, %d )', 1e99 );
0103 
0104 
0105 if Q.ATMOSPHERE_DIM == 1
0106   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0107                  'INCLUDE "planetary_toolbox/includes/common/getgrids_1D.arts"';
0108   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0109                  'INCLUDE "planetary_toolbox/includes/common/makeatmo1D.arts"';
0110 elseif Q.ATMOSPHERE_DIM == 3
0111   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( latmin, %d )', ...
0112                                                                    A.latmin );
0113   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( latmax, %d )', ...
0114                                                                    A.latmax );
0115   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( lonmin, %d )', ...
0116                                                                    A.lonmin );
0117   Q.WSMS_BEFORE_ATMSURF{end+1} = sprintf( 'NumericSet( lonmax, %d )', ...
0118                                                                    A.lonmax );
0119   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0120                 'INCLUDE "planetary_toolbox/includes/common/getgrids_3D.arts"';
0121   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0122                  'INCLUDE "planetary_toolbox/includes/common/makeatmo3D.arts"';
0123 else
0124   error( 'Only 1D and 3D atmosphere can be generated.' );
0125 end
0126 
0127 
0128 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexSet( EWwind, [0] )';
0129 Q.WSMS_BEFORE_ATMSURF{end+1} = 'ArrayOfIndexSet( NSwind, [0] )';
0130 
0131 u_wind = safegetfield( A, 'wind_u', 0 );
0132 v_wind = safegetfield( A, 'wind_v', 0 );
0133 
0134 if u_wind | v_wind
0135   Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0136                'INCLUDE "planetary_toolbox/includes/venus/getwind_venus.arts"';
0137   if u_wind 
0138     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( rawfield, wind_u_raw )';
0139     if Q.ATMOSPHERE_DIM == 1
0140       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0141                 'INCLUDE "planetary_toolbox/includes/common/makefield1D.arts"';
0142     else
0143       Q.WSMS_BEFORE_ATMSURF{end+1} = ...
0144                 'INCLUDE "planetary_toolbox/includes/common/makefield3D.arts"';
0145     end
0146     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( wind_u_field, finalfield )';
0147   end
0148   if v_wind 
0149     Q.WSMS_BEFORE_ATMSURF{end+1} = 'Copy( rawfield, wind_v_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_v_field, finalfield )';
0158   end
0159 end
0160 
0161 
0162 
0163

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