psmile_trf_lonlat_2d_dble.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PSMILe_Trf_lonlat_2d_dble
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_trf_lonlat_2d_dble (x_coords, y_coords,             &
00012                                             coords_shape, grid_valid_shape, &
00013                                             sin_values, cos_values, ierror)
00014 !
00015 ! !USES:
00016 !
00017       use PRISM_constants
00018 !
00019       use PSMILe, dummy_interface => PSMILe_Trf_lonlat_2d_dble
00020 
00021       implicit none
00022 !
00023 ! !INPUT PARAMETERS:
00024 !
00025       Integer, Intent (In)            :: coords_shape (2, ndim_2d)
00026 
00027 !     Dimension of coordinates (method) x_coords, ...
00028 
00029       Double Precision, Intent (In)   :: x_coords(coords_shape(1,1): 
00030                                                   coords_shape(2,1), 
00031                                                   coords_shape(1,2): 
00032                                                   coords_shape(2,2))
00033       Double Precision, Intent (In)   :: y_coords(coords_shape(1,1): 
00034                                                   coords_shape(2,1), 
00035                                                   coords_shape(1,2): 
00036                                                   coords_shape(2,2))
00037 
00038 !     Coordinates of the method
00039 
00040       Integer, Intent (In)            :: grid_valid_shape (2, ndim_2d)
00041 
00042 !     Specifies the valid block shape for the "ndim_3d"-dimensional block
00043 
00044 !
00045 ! !OUTPUT PARAMETERS:
00046 !
00047       Double Precision, Intent (Out)  :: sin_values (grid_valid_shape(1,1): 
00048                                                      grid_valid_shape(2,1), 
00049                                                      grid_valid_shape(1,2): 
00050                                                      grid_valid_shape(2,2), 
00051                                                      2)
00052 
00053 !     Array returning the sin values for lon and lat
00054 
00055       Double Precision, Intent (Out)  :: cos_values (grid_valid_shape(1,1): 
00056                                                      grid_valid_shape(2,1), 
00057                                                      grid_valid_shape(1,2): 
00058                                                      grid_valid_shape(2,2), 
00059                                                      2)
00060 
00061 !     Array returning the cos values for lon and lat
00062 !
00063       Integer, Intent (Out)           :: ierror
00064 
00065 !     Returns the error code of PSMILE_Trf_lonlat_2d_dble;
00066 !             ierror = 0 : No error
00067 !             ierror > 0 : Severe error
00068 !
00069 ! !DEFINED PARAMETERS:
00070 !
00071 !  lon   = Index of Longitudes in arrays "sin_values" and "cos_values"
00072 !  lat   = Index of Latitudes  in arrays "sin_values" and "cos_values"
00073 !
00074       Integer, Parameter              :: lon = 1
00075       Integer, Parameter              :: lat = 2
00076 !
00077 ! !LOCAL VARIABLES
00078 !
00079 !     ... for error handling
00080 !
00081 !     Integer, Parameter              :: nerrp = 2
00082 !     Integer                         :: ierrp (nerrp)
00083 !
00084 !
00085 ! !DESCRIPTION:
00086 !
00087 ! Subroutine "PSMILe_Trf_lonlat_2d_dble" computes sin and cos values of
00088 ! the Longitudes and Latitudes of a 2d-dimensional grid of type
00089 ! "PRISM_Irrlonlat_Regvrt".
00090 !
00091 ! !REVISION HISTORY:
00092 !
00093 !   Date      Programmer   Description
00094 ! ----------  ----------   -----------
00095 ! 03.07.21    H. Ritzdorf  created
00096 !
00097 !EOP
00098 !----------------------------------------------------------------------
00099 !
00100 !  $Id: psmile_trf_lonlat_2d_dble.F90 2325 2010-04-21 15:00:07Z valcke $
00101 !  $Author: valcke $
00102 !
00103    Character(len=len_cvs_string), save :: mycvs = 
00104        '$Id: psmile_trf_lonlat_2d_dble.F90 2325 2010-04-21 15:00:07Z valcke $'
00105 !----------------------------------------------------------------------
00106 !
00107 !  Initialization
00108 !
00109 #ifdef VERBOSE
00110       print 9990, trim(ch_id)
00111 
00112       call psmile_flushstd
00113 #endif /* VERBOSE */
00114 
00115       ierror = 0
00116 !
00117 #ifdef PRISM_ASSERTION
00118 #endif
00119 !
00120 !===> Transform from degrees into radients
00121 !     ? TODO: Lohnt es sich hier, grid_valid_shape == coords_shape
00122 !             zu kontrollieren und dann die
00123 !             Zuweisungen ohne grid_valid_shape Angabe zu machen ?
00124 !     sin_values (:, :, lon) = x_coords (:, :) * dble_deg2rad
00125 !             Oder macht das schon der Compiler ?
00126 !
00127       sin_values (:, :, lon) = &
00128         x_coords (grid_valid_shape(1,1):grid_valid_shape(2,1),        &
00129                   grid_valid_shape(1,2):grid_valid_shape(2,2)) *      &
00130         dble_deg2rad
00131 !
00132       sin_values (:, :, lat) = &
00133         y_coords (grid_valid_shape(1,1):grid_valid_shape(2,1),        &
00134                   grid_valid_shape(1,2):grid_valid_shape(2,2)) *      &
00135         dble_deg2rad
00136 !
00137 !===> Compute cos and sin values
00138 !
00139       cos_values = cos (sin_values)
00140       sin_values = sin (sin_values)
00141 !
00142 !===> All done
00143 !
00144 #ifdef VERBOSE
00145       print 9980, trim(ch_id), ierror
00146 
00147       call psmile_flushstd
00148 #endif /* VERBOSE */
00149 !
00150 !  Formats:
00151 !
00152 9990 format (1x, a, ': psmile_trf_lonlat_2d_dble')
00153 9980 format (1x, a, ': psmile_trf_lonlat_2d_dble: eof, ierror =', i3)
00154 
00155       end subroutine PSMILe_Trf_lonlat_2d_dble

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1