c...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+ c File: mopagras.f (Fortran 77 source for the mopagras program) c Author: Fredrik Jonsson c Date: December 26, 2005 c Last change: January 3, 2006 c Description: The mopagras program calculates field envelopes of c forward and backward travelling wave components inside c a magneto-optically parametric bragg grating of sinusoi- c dal spatial distribution of the refractive index. c The program essentially wraps the calculating core c provided by the mopagrat routine (see file mopagrat.f) c into a stand-alone executable program, in which command- c line parsing for parameters and output files is support- c ed, as well as including the possibility to specifying c different scan parameters, i.e. specifying different c variables to be varied in investigating for example c optimization or phase matching properties of the c parametric process. c C Copyright (C) 2006, Fredrik Jonsson c...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+ c program main implicit logical (a-z) external zgaussj,mopagrat,ccubsolv logical verbose integer*4 j1,j2,k,numargs,oid_lcp,oid_rcp,num_scan_params integer*4 i_alpha,num_alpha_steps integer*4 i_beta,num_beta_steps integer*4 i_gamma,num_gamma_steps integer*4 i_delta,num_delta_steps integer*4 i_eta,num_eta_steps integer*4 i_kappa,num_kappa_steps integer*4 i_length,num_length_steps integer*4 i_zeta,num_zeta_steps integer*4 i_magfield,num_magfield_steps real*8 alpha,alphastart,alphastop,dalpha real*8 beta,betastart,betastop,dbeta real*8 gamma,gammastart,gammastop,dgamma real*8 delta,deltastart,deltastop,ddelta real*8 eta,etastart,etastop,deta real*8 kappa,kappastart,kappastop,dkappa real*8 length,lengthstart,lengthstop,dlength real*8 zeta,zetastart,zetastop,dzeta real*8 magfield,magfieldstart,magfieldstop,dmagfield real*8 tmpreal,tmpgamma,tmpdelta complex*8 a1iplus,a2iplus,a1fplus,a1bplus,a2fplus complex*8 a1iminus,a2iminus,a1fminus,a1bminus,a2fminus real*8 a1famplplus,a1bamplplus,a2famplplus real*8 a1famplminus,a1bamplminus,a2famplminus character*48 arg,outfilename_lcp,outfilename_rcp c ********************************************************************* c Initialization of variables with default values c ********************************************************************* verbose=false outfilename_lcp='out.lcp.dat' outfilename_rcp='out.rcp.dat' oid_lcp=10 oid_rcp=11 num_scan_params=0 a1fplus=cmplx(0.0,0.0) a1bplus=cmplx(0.0,0.0) a2fplus=cmplx(0.0,0.0) a1fminus=cmplx(0.0,0.0) a1bminus=cmplx(0.0,0.0) a2fminus=cmplx(0.0,0.0) alpha=0.0d0 alphastart=0.0d0 alphastop=0.0d0 dalpha=-1.0d0 num_alpha_steps=1 beta=0.0d0 betastart=0.0d0 betastop=1.0d0 dbeta=-1.0d0 num_beta_steps=1 gamma=0.0d0 gammastart=0.0d0 gammastop=1.0d0 dgamma=-1.0d0 num_gamma_steps=1 delta=0.0d0 deltastart=0.0d0 deltastop=1.0d0 ddelta=-1.0d0 num_delta_steps=1 eta=0.0d0 etastart=0.0d0 etastop=1.0d0 deta=-1.0d0 num_eta_steps=1 kappa=0.0d0 kappastart=0.0d0 kappastop=1.0d0 dkappa=-1.0d0 num_kappa_steps=1 length=0.0d0 lengthstart=0.0d0 lengthstop=1.0d0 dlength=-1.0d0 num_length_steps=1 zeta=0.0d0 zetastart=0.0d0 zetastop=1.0d0 dzeta=-1.0d0 num_zeta_steps=1 magfield=0.0d0 magfieldstart=0.0d0 magfieldstop=0.0d0 dmagfield=1.0d0 num_magfield_steps=1 a1iplus=cmplx(0.0,0.0) a2iplus=cmplx(0.0,0.0) a1iminus=cmplx(0.0,0.0) a2iminus=cmplx(0.0,0.0) a1famplplus=cmplx(0.0,0.0) a1bamplplus=cmplx(0.0,0.0) a2famplplus=cmplx(0.0,0.0) a1famplminus=cmplx(0.0,0.0) a1bamplminus=cmplx(0.0,0.0) a2famplminus=cmplx(0.0,0.0) c ********************************************************************* c Get the input and output file names from the argument list. c in parsing the list of numerical intervals of the form c c