Answer Question
Time zero variables
Hi All,
I am trying to build one module that reads a .txt file to get parameters and after that generate waveform based on these parameters. This means I need to use Time zero to initialize these parameters by RTCI and RTCF. I was a little bit success by doing so. However, if I put two modules at the same page, the generate same waveforms eventhough the input files are different. I guess the reason is because of the data in RTCI and RTCF are shared between these moduldes. I tried to increase the NRTCI and NRTCF but I make some error. Can anyone give some suggestions?
I attach models for detail (sorry I could not upload with a .zip, the website give some errors).
Also, have anyone try to declare the Character variables? I tried this for file reading(file name) but it got error.
#LOCAL INTEGER k #LOCAL INTEGER nHarm($Nh) #LOCAL REAL mHarm($Nh) #LOCAL INTEGER m #BEGIN OPEN(UNIT = 500,FILE = "$fname",STATUS = 'OLD',ACTION = 'READ') do k = 1, $Nh read(500,*) RTCI(NRTCI + k-1), RTCF(NRTCF + k-1) end do #ENDBEGIN ! An alternate method for BEGIN ENDBEGIN ! Reading file and save initial values of frequency and magnitude into STORAGE and then assigned to ! IF (TIMEZERO) THEN ! OPEN(UNIT = 500,FILE = "$fname",STATUS = 'OLD',ACTION = 'READ') ! do k = 1, $Nh ! read(500,*) RTCI(NRTCI + k-1), RTCF(NRTCF + k-1) ! end do ! CLOSE(500) !! NRTCI = NRTCI+$Nh !! NRTCF = NRTCF+$Nh ! ENDIF ! Assign data to nHarm and mHarm do k = 1, $Nh nHarm(k) = RTCI(NRTCI + k-1) mHarm(k) = RTCF(NRTCF + k-1) end do ! ! $out = 0.0 do k = 1, $Nh $out = $out + mHarm(k)*sin(nHarm(k)*(TWO_PI*$F_fund)*time +($ph*PI_BY180)) end do
Thank you so much for your all help.
Best,
Tuan
I am trying to build one module that reads a .txt file to get parameters and after that generate waveform based on these parameters. This means I need to use Time zero to initialize these parameters by RTCI and RTCF. I was a little bit success by doing so. However, if I put two modules at the same page, the generate same waveforms eventhough the input files are different. I guess the reason is because of the data in RTCI and RTCF are shared between these moduldes. I tried to increase the NRTCI and NRTCF but I make some error. Can anyone give some suggestions?
I attach models for detail (sorry I could not upload with a .zip, the website give some errors).
Also, have anyone try to declare the Character variables? I tried this for file reading(file name) but it got error.
#LOCAL INTEGER k #LOCAL INTEGER nHarm($Nh) #LOCAL REAL mHarm($Nh) #LOCAL INTEGER m #BEGIN OPEN(UNIT = 500,FILE = "$fname",STATUS = 'OLD',ACTION = 'READ') do k = 1, $Nh read(500,*) RTCI(NRTCI + k-1), RTCF(NRTCF + k-1) end do #ENDBEGIN ! An alternate method for BEGIN ENDBEGIN ! Reading file and save initial values of frequency and magnitude into STORAGE and then assigned to ! IF (TIMEZERO) THEN ! OPEN(UNIT = 500,FILE = "$fname",STATUS = 'OLD',ACTION = 'READ') ! do k = 1, $Nh ! read(500,*) RTCI(NRTCI + k-1), RTCF(NRTCF + k-1) ! end do ! CLOSE(500) !! NRTCI = NRTCI+$Nh !! NRTCF = NRTCF+$Nh ! ENDIF ! Assign data to nHarm and mHarm do k = 1, $Nh nHarm(k) = RTCI(NRTCI + k-1) mHarm(k) = RTCF(NRTCF + k-1) end do ! ! $out = 0.0 do k = 1, $Nh $out = $out + mHarm(k)*sin(nHarm(k)*(TWO_PI*$F_fund)*time +($ph*PI_BY180)) end do
Thank you so much for your all help.
Best,
Tuan