COSMOS v7.655  COSMOSv7655
(AirShowerMC)
csetMagField.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine csetmagfield (sys, b1, b2, b3, b)
 brief set Calculated magnetic field to /magfield/ b More...
 

Function/Subroutine Documentation

◆ csetmagfield()

subroutine csetmagfield ( character*(*)  sys,
real*8  b1,
real*8  b2,
real*8  b3,
type(magfield b 
)

brief set Calculated magnetic field to /magfield/ b

Parameters
[in]syswhich system. 'xyz', 'hva', 'ned' etc data type character*3.
[in]b1,b2,b33 components of mag. in the system 'sys' data type real*8
[out]b/magfield/

Definition at line 6 of file csetMagField.f.

References cerrormsg(), and mag_types().

Referenced by cgeomag(), chva2ned(), cned2ecent(), cned2hva(), and cxyz2ned().

6 ! set magnetic field strength in b
7 ! sys: character*3. input. which system. 'xyz', 'hva', 'ned' etc
8 ! b1,b2,b3:real*8 input. 3 components of mag. in the system 'sys'
9 ! b: /magfield/ . output.
10 !
11  implicit none
12 #include "Zmagfield.h"
13  character*(*) sys
14  real*8 b1, b2, b3
15  type(magfield)::b
16 !
17  character*70 msg
18  integer i
19 #include "Zmagfieldtp.h"
20 
21  do i=1, max_mag_types
22  if(sys .eq. mag_types(i)) then
23  b%x = b1
24  b%y = b2
25  b%z = b3
26  b%sys = sys
27  goto 10
28  endif
29  enddo
30  write(msg, *) ' error sys=',sys,'to csetMagField'
31  call cerrormsg(msg, 0)
32  10 continue
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
nodes i
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz sys
Definition: ZavoidUnionMap.h:1
real(4), save b
Definition: cNRLAtmos.f:21
! magnetic field component expressions ! this should be placed at last part of the declaration integer max_mag_types * mag_types(2)/'hva'/
Here is the call graph for this function:
Here is the caller graph for this function: